mirror of
https://github.com/sasjs/lint.git
synced 2025-12-10 17:34:36 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12bfcd69bd | ||
|
|
6350d32d0c |
@@ -34,6 +34,27 @@ describe('hasDoxygenHeader', () => {
|
|||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should return an array with a single diagnostic when the file has comment blocks but no header', () => {
|
||||||
|
const content = `
|
||||||
|
%macro mf_getuniquelibref(prefix=mclib,maxtries=1000);
|
||||||
|
%local x libref;
|
||||||
|
%let x={SAS002};
|
||||||
|
/** Comment Line 1
|
||||||
|
* Comment Line 2
|
||||||
|
*/
|
||||||
|
%do x=0 %to &maxtries;`
|
||||||
|
|
||||||
|
expect(hasDoxygenHeader.test(content)).toEqual([
|
||||||
|
{
|
||||||
|
message: 'File missing Doxygen header',
|
||||||
|
lineNumber: 1,
|
||||||
|
startColumnNumber: 1,
|
||||||
|
endColumnNumber: 1,
|
||||||
|
severity: Severity.Warning
|
||||||
|
}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
it('should return an array with a single diagnostic when the file is undefined', () => {
|
it('should return an array with a single diagnostic when the file is undefined', () => {
|
||||||
const content = undefined
|
const content = undefined
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const description =
|
|||||||
const message = 'File missing Doxygen header'
|
const message = 'File missing Doxygen header'
|
||||||
const test = (value: string) => {
|
const test = (value: string) => {
|
||||||
try {
|
try {
|
||||||
const hasFileHeader = value.split('/**')[0] !== value
|
const hasFileHeader = value.trimStart().startsWith('/*')
|
||||||
if (hasFileHeader) return []
|
if (hasFileHeader) return []
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user