mirror of
https://github.com/sasjs/lint.git
synced 2026-01-08 13:00:06 +00:00
feat(lint): add rules for lowercase file names, max line length and no tab indentation
This commit is contained in:
27
src/rules/lowerCaseFileNames.spec.ts
Normal file
27
src/rules/lowerCaseFileNames.spec.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Severity } from '../types/Severity'
|
||||
import { lowerCaseFileNames } from './lowerCaseFileNames'
|
||||
|
||||
describe('lowerCaseFileNames', () => {
|
||||
it('should return an empty array when the file name has no uppercase characters', () => {
|
||||
const filePath = '/code/sas/my_sas_file.sas'
|
||||
expect(lowerCaseFileNames.test(filePath)).toEqual([])
|
||||
})
|
||||
|
||||
it('should return an empty array when the file name has no uppercase characters, even if the containing folder has uppercase characters', () => {
|
||||
const filePath = '/code/SAS Projects/my_sas_file.sas'
|
||||
expect(lowerCaseFileNames.test(filePath)).toEqual([])
|
||||
})
|
||||
|
||||
it('should return an array with a single diagnostic when the file name has uppercase characters', () => {
|
||||
const filePath = '/code/sas/my SAS file.sas'
|
||||
expect(lowerCaseFileNames.test(filePath)).toEqual([
|
||||
{
|
||||
message: 'File name contains uppercase characters',
|
||||
lineNumber: 1,
|
||||
startColumnNumber: 1,
|
||||
endColumnNumber: 1,
|
||||
severity: Severity.Warning
|
||||
}
|
||||
])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user