1
0
mirror of https://github.com/sasjs/lint.git synced 2025-12-10 17:34:36 +00:00

fix(hasMacroNameInMend): default sets to true

This commit is contained in:
Saad Jutt
2021-04-15 16:33:31 +05:00
parent 031a323839
commit c56887d6e6
6 changed files with 27 additions and 6 deletions

View File

@@ -7,7 +7,7 @@
"lowerCaseFileNames": true,
"noTabIndentation": true,
"indentationMultiple": 2,
"hasMacroNameInMend": false,
"hasMacroNameInMend": true,
"noNestedMacros": true,
"hasMacroParentheses": true
}

View File

@@ -8,7 +8,7 @@ describe('lintFile', () => {
path.join(__dirname, '..', 'Example File.sas')
)
expect(results.length).toEqual(8)
expect(results.length).toEqual(9)
expect(results).toContainEqual({
message: 'Line contains trailing spaces',
lineNumber: 1,
@@ -65,5 +65,12 @@ describe('lintFile', () => {
endColumnNumber: 1,
severity: Severity.Warning
})
expect(results).toContainEqual({
message: '%mend statement is missing macro name - mf_getuniquelibref',
lineNumber: 17,
startColumnNumber: 3,
endColumnNumber: 9,
severity: 1
})
})
})

View File

@@ -10,7 +10,7 @@ describe('lintFolder', () => {
const diagnostics = results.get(
path.join(__dirname, '..', 'Example File.sas')
)!
expect(diagnostics.length).toEqual(8)
expect(diagnostics.length).toEqual(9)
expect(diagnostics).toContainEqual({
message: 'Line contains trailing spaces',
lineNumber: 1,
@@ -67,5 +67,12 @@ describe('lintFolder', () => {
endColumnNumber: 1,
severity: Severity.Warning
})
expect(diagnostics).toContainEqual({
message: '%mend statement is missing macro name - mf_getuniquelibref',
lineNumber: 17,
startColumnNumber: 3,
endColumnNumber: 9,
severity: 1
})
})
})

View File

@@ -15,7 +15,7 @@ describe('lintProject', () => {
const diagnostics = results.get(
path.join(__dirname, '..', 'Example File.sas')
)!
expect(diagnostics.length).toEqual(8)
expect(diagnostics.length).toEqual(9)
expect(diagnostics).toContainEqual({
message: 'Line contains trailing spaces',
lineNumber: 1,
@@ -72,6 +72,13 @@ describe('lintProject', () => {
endColumnNumber: 1,
severity: Severity.Warning
})
expect(diagnostics).toContainEqual({
message: '%mend statement is missing macro name - mf_getuniquelibref',
lineNumber: 17,
startColumnNumber: 3,
endColumnNumber: 9,
severity: 1
})
})
it('should throw an error when a project root is not found', async () => {

View File

@@ -17,7 +17,7 @@ describe('getLintConfig', () => {
const config = await getLintConfig()
expect(config).toBeInstanceOf(LintConfig)
expect(config.fileLintRules.length).toEqual(3)
expect(config.fileLintRules.length).toEqual(4)
expect(config.lineLintRules.length).toEqual(5)
expect(config.pathLintRules.length).toEqual(2)
})

View File

@@ -15,7 +15,7 @@ export const DefaultLintConfiguration = {
maxLineLength: 80,
noTabIndentation: true,
indentationMultiple: 2,
hasMacroNameInMend: false,
hasMacroNameInMend: true,
noNestedMacros: true,
hasMacroParentheses: true
}