diff --git a/src/rules/hasDoxygenHeader.spec.ts b/src/rules/file/hasDoxygenHeader.spec.ts similarity index 97% rename from src/rules/hasDoxygenHeader.spec.ts rename to src/rules/file/hasDoxygenHeader.spec.ts index 4229c59..2bf1259 100644 --- a/src/rules/hasDoxygenHeader.spec.ts +++ b/src/rules/file/hasDoxygenHeader.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { hasDoxygenHeader } from './hasDoxygenHeader' describe('hasDoxygenHeader', () => { diff --git a/src/rules/hasDoxygenHeader.ts b/src/rules/file/hasDoxygenHeader.ts similarity index 84% rename from src/rules/hasDoxygenHeader.ts rename to src/rules/file/hasDoxygenHeader.ts index 0a367ab..aa7c0bc 100644 --- a/src/rules/hasDoxygenHeader.ts +++ b/src/rules/file/hasDoxygenHeader.ts @@ -1,6 +1,6 @@ -import { FileLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { FileLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' const name = 'hasDoxygenHeader' const description = diff --git a/src/rules/hasMacroNameInMend.spec.ts b/src/rules/file/hasMacroNameInMend.spec.ts similarity index 99% rename from src/rules/hasMacroNameInMend.spec.ts rename to src/rules/file/hasMacroNameInMend.spec.ts index 5cb10c8..81d3b2e 100644 --- a/src/rules/hasMacroNameInMend.spec.ts +++ b/src/rules/file/hasMacroNameInMend.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { hasMacroNameInMend } from './hasMacroNameInMend' describe('hasMacroNameInMend', () => { diff --git a/src/rules/hasMacroNameInMend.ts b/src/rules/file/hasMacroNameInMend.ts similarity index 90% rename from src/rules/hasMacroNameInMend.ts rename to src/rules/file/hasMacroNameInMend.ts index db8deda..fec97cb 100644 --- a/src/rules/hasMacroNameInMend.ts +++ b/src/rules/file/hasMacroNameInMend.ts @@ -1,9 +1,9 @@ -import { Diagnostic } from '../types/Diagnostic' -import { FileLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' -import { trimComments } from '../utils/trimComments' -import { getColumnNumber } from '../utils/getColumnNumber' +import { Diagnostic } from '../../types/Diagnostic' +import { FileLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' +import { trimComments } from '../../utils/trimComments' +import { getColumnNumber } from '../../utils/getColumnNumber' const name = 'hasMacroNameInMend' const description = diff --git a/src/rules/hasMacroParentheses.spec.ts b/src/rules/file/hasMacroParentheses.spec.ts similarity index 98% rename from src/rules/hasMacroParentheses.spec.ts rename to src/rules/file/hasMacroParentheses.spec.ts index 1b75567..438f054 100644 --- a/src/rules/hasMacroParentheses.spec.ts +++ b/src/rules/file/hasMacroParentheses.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { hasMacroParentheses } from './hasMacroParentheses' describe('hasMacroParentheses', () => { diff --git a/src/rules/hasMacroParentheses.ts b/src/rules/file/hasMacroParentheses.ts similarity index 88% rename from src/rules/hasMacroParentheses.ts rename to src/rules/file/hasMacroParentheses.ts index 593867a..9597674 100644 --- a/src/rules/hasMacroParentheses.ts +++ b/src/rules/file/hasMacroParentheses.ts @@ -1,9 +1,9 @@ -import { Diagnostic } from '../types/Diagnostic' -import { FileLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' -import { trimComments } from '../utils/trimComments' -import { getColumnNumber } from '../utils/getColumnNumber' +import { Diagnostic } from '../../types/Diagnostic' +import { FileLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' +import { trimComments } from '../../utils/trimComments' +import { getColumnNumber } from '../../utils/getColumnNumber' const name = 'hasMacroParentheses' const description = 'Enforces the presence of parentheses in macro definitions.' diff --git a/src/rules/file/index.ts b/src/rules/file/index.ts new file mode 100644 index 0000000..e551bdd --- /dev/null +++ b/src/rules/file/index.ts @@ -0,0 +1,4 @@ +export { hasDoxygenHeader } from './hasDoxygenHeader' +export { hasMacroNameInMend } from './hasMacroNameInMend' +export { hasMacroParentheses } from './hasMacroParentheses' +export { noNestedMacros } from './noNestedMacros' diff --git a/src/rules/noNestedMacros.spec.ts b/src/rules/file/noNestedMacros.spec.ts similarity index 97% rename from src/rules/noNestedMacros.spec.ts rename to src/rules/file/noNestedMacros.spec.ts index d77aa5b..b9ad5c9 100644 --- a/src/rules/noNestedMacros.spec.ts +++ b/src/rules/file/noNestedMacros.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { noNestedMacros } from './noNestedMacros' describe('noNestedMacros', () => { diff --git a/src/rules/noNestedMacros.ts b/src/rules/file/noNestedMacros.ts similarity index 85% rename from src/rules/noNestedMacros.ts rename to src/rules/file/noNestedMacros.ts index 69568a7..dca0802 100644 --- a/src/rules/noNestedMacros.ts +++ b/src/rules/file/noNestedMacros.ts @@ -1,9 +1,9 @@ -import { Diagnostic } from '../types/Diagnostic' -import { FileLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' -import { trimComments } from '../utils/trimComments' -import { getColumnNumber } from '../utils/getColumnNumber' +import { Diagnostic } from '../../types/Diagnostic' +import { FileLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' +import { trimComments } from '../../utils/trimComments' +import { getColumnNumber } from '../../utils/getColumnNumber' const name = 'noNestedMacros' const description = 'Enfoces the absence of nested macro definitions.' diff --git a/src/rules/indentationMultiple.spec.ts b/src/rules/line/indentationMultiple.spec.ts similarity index 98% rename from src/rules/indentationMultiple.spec.ts rename to src/rules/line/indentationMultiple.spec.ts index b5a84e0..205b6d5 100644 --- a/src/rules/indentationMultiple.spec.ts +++ b/src/rules/line/indentationMultiple.spec.ts @@ -1,4 +1,4 @@ -import { LintConfig, Severity } from '../types' +import { LintConfig, Severity } from '../../types' import { indentationMultiple } from './indentationMultiple' describe('indentationMultiple', () => { diff --git a/src/rules/indentationMultiple.ts b/src/rules/line/indentationMultiple.ts similarity index 83% rename from src/rules/indentationMultiple.ts rename to src/rules/line/indentationMultiple.ts index 0517ddf..a5345c4 100644 --- a/src/rules/indentationMultiple.ts +++ b/src/rules/line/indentationMultiple.ts @@ -1,7 +1,7 @@ -import { LintConfig } from '../types' -import { LineLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { LintConfig } from '../../types' +import { LineLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' const name = 'indentationMultiple' const description = 'Ensure indentation by a multiple of the configured number.' diff --git a/src/rules/line/index.ts b/src/rules/line/index.ts new file mode 100644 index 0000000..e8b0f70 --- /dev/null +++ b/src/rules/line/index.ts @@ -0,0 +1,5 @@ +export { indentationMultiple } from './indentationMultiple' +export { maxLineLength } from './maxLineLength' +export { noEncodedPasswords } from './noEncodedPasswords' +export { noTabIndentation } from './noTabIndentation' +export { noTrailingSpaces } from './noTrailingSpaces' diff --git a/src/rules/maxLineLength.spec.ts b/src/rules/line/maxLineLength.spec.ts similarity index 96% rename from src/rules/maxLineLength.spec.ts rename to src/rules/line/maxLineLength.spec.ts index c763d26..ad79d1c 100644 --- a/src/rules/maxLineLength.spec.ts +++ b/src/rules/line/maxLineLength.spec.ts @@ -1,4 +1,4 @@ -import { LintConfig, Severity } from '../types' +import { LintConfig, Severity } from '../../types' import { maxLineLength } from './maxLineLength' describe('maxLineLength', () => { diff --git a/src/rules/maxLineLength.ts b/src/rules/line/maxLineLength.ts similarity index 78% rename from src/rules/maxLineLength.ts rename to src/rules/line/maxLineLength.ts index 8d054c7..8cc6e8c 100644 --- a/src/rules/maxLineLength.ts +++ b/src/rules/line/maxLineLength.ts @@ -1,7 +1,7 @@ -import { LintConfig } from '../types' -import { LineLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { LintConfig } from '../../types' +import { LineLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' const name = 'maxLineLength' const description = 'Restrict lines to the specified length.' diff --git a/src/rules/noEncodedPasswords.spec.ts b/src/rules/line/noEncodedPasswords.spec.ts similarity index 97% rename from src/rules/noEncodedPasswords.spec.ts rename to src/rules/line/noEncodedPasswords.spec.ts index bd7e3d9..15b986e 100644 --- a/src/rules/noEncodedPasswords.spec.ts +++ b/src/rules/line/noEncodedPasswords.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { noEncodedPasswords } from './noEncodedPasswords' describe('noEncodedPasswords', () => { diff --git a/src/rules/noEncodedPasswords.ts b/src/rules/line/noEncodedPasswords.ts similarity index 83% rename from src/rules/noEncodedPasswords.ts rename to src/rules/line/noEncodedPasswords.ts index 2cbf600..35914aa 100644 --- a/src/rules/noEncodedPasswords.ts +++ b/src/rules/line/noEncodedPasswords.ts @@ -1,6 +1,6 @@ -import { LineLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { LineLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' const name = 'noEncodedPasswords' const description = 'Disallow encoded passwords in SAS code.' diff --git a/src/rules/noTabIndentation.spec.ts b/src/rules/line/noTabIndentation.spec.ts similarity index 93% rename from src/rules/noTabIndentation.spec.ts rename to src/rules/line/noTabIndentation.spec.ts index ea300a8..c3d7033 100644 --- a/src/rules/noTabIndentation.spec.ts +++ b/src/rules/line/noTabIndentation.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { noTabIndentation } from './noTabIndentation' describe('noTabs', () => { diff --git a/src/rules/noTabIndentation.ts b/src/rules/line/noTabIndentation.ts similarity index 78% rename from src/rules/noTabIndentation.ts rename to src/rules/line/noTabIndentation.ts index af2a46b..1158bf7 100644 --- a/src/rules/noTabIndentation.ts +++ b/src/rules/line/noTabIndentation.ts @@ -1,6 +1,6 @@ -import { LineLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { LineLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' const name = 'noTabs' const description = 'Disallow indenting with tabs.' diff --git a/src/rules/noTrailingSpaces.spec.ts b/src/rules/line/noTrailingSpaces.spec.ts similarity index 93% rename from src/rules/noTrailingSpaces.spec.ts rename to src/rules/line/noTrailingSpaces.spec.ts index 76504f3..928e2a0 100644 --- a/src/rules/noTrailingSpaces.spec.ts +++ b/src/rules/line/noTrailingSpaces.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { noTrailingSpaces } from './noTrailingSpaces' describe('noTrailingSpaces', () => { diff --git a/src/rules/noTrailingSpaces.ts b/src/rules/line/noTrailingSpaces.ts similarity index 80% rename from src/rules/noTrailingSpaces.ts rename to src/rules/line/noTrailingSpaces.ts index f5ef0d7..0fe4bc1 100644 --- a/src/rules/noTrailingSpaces.ts +++ b/src/rules/line/noTrailingSpaces.ts @@ -1,6 +1,6 @@ -import { LineLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { LineLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' const name = 'noTrailingSpaces' const description = 'Disallow trailing spaces on lines.' diff --git a/src/rules/path/index.ts b/src/rules/path/index.ts new file mode 100644 index 0000000..083d94a --- /dev/null +++ b/src/rules/path/index.ts @@ -0,0 +1,2 @@ +export { lowerCaseFileNames } from './lowerCaseFileNames' +export { noSpacesInFileNames } from './noSpacesInFileNames' diff --git a/src/rules/lowerCaseFileNames.spec.ts b/src/rules/path/lowerCaseFileNames.spec.ts similarity index 95% rename from src/rules/lowerCaseFileNames.spec.ts rename to src/rules/path/lowerCaseFileNames.spec.ts index 4ecaddb..66c1cf5 100644 --- a/src/rules/lowerCaseFileNames.spec.ts +++ b/src/rules/path/lowerCaseFileNames.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { lowerCaseFileNames } from './lowerCaseFileNames' describe('lowerCaseFileNames', () => { diff --git a/src/rules/lowerCaseFileNames.ts b/src/rules/path/lowerCaseFileNames.ts similarity index 81% rename from src/rules/lowerCaseFileNames.ts rename to src/rules/path/lowerCaseFileNames.ts index 2eb8e51..0d6e53c 100644 --- a/src/rules/lowerCaseFileNames.ts +++ b/src/rules/path/lowerCaseFileNames.ts @@ -1,6 +1,6 @@ -import { PathLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { PathLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' import path from 'path' const name = 'lowerCaseFileNames' diff --git a/src/rules/noSpacesInFileNames.spec.ts b/src/rules/path/noSpacesInFileNames.spec.ts similarity index 95% rename from src/rules/noSpacesInFileNames.spec.ts rename to src/rules/path/noSpacesInFileNames.spec.ts index 4b7962b..317f5fc 100644 --- a/src/rules/noSpacesInFileNames.spec.ts +++ b/src/rules/path/noSpacesInFileNames.spec.ts @@ -1,4 +1,4 @@ -import { Severity } from '../types/Severity' +import { Severity } from '../../types/Severity' import { noSpacesInFileNames } from './noSpacesInFileNames' describe('noSpacesInFileNames', () => { diff --git a/src/rules/noSpacesInFileNames.ts b/src/rules/path/noSpacesInFileNames.ts similarity index 81% rename from src/rules/noSpacesInFileNames.ts rename to src/rules/path/noSpacesInFileNames.ts index 6723ea3..403f536 100644 --- a/src/rules/noSpacesInFileNames.ts +++ b/src/rules/path/noSpacesInFileNames.ts @@ -1,6 +1,6 @@ -import { PathLintRule } from '../types/LintRule' -import { LintRuleType } from '../types/LintRuleType' -import { Severity } from '../types/Severity' +import { PathLintRule } from '../../types/LintRule' +import { LintRuleType } from '../../types/LintRuleType' +import { Severity } from '../../types/Severity' import path from 'path' const name = 'noSpacesInFileNames' diff --git a/src/types/LintConfig.ts b/src/types/LintConfig.ts index bec64f5..3dea4b1 100644 --- a/src/types/LintConfig.ts +++ b/src/types/LintConfig.ts @@ -1,14 +1,17 @@ -import { hasDoxygenHeader } from '../rules/hasDoxygenHeader' -import { indentationMultiple } from '../rules/indentationMultiple' -import { lowerCaseFileNames } from '../rules/lowerCaseFileNames' -import { maxLineLength } from '../rules/maxLineLength' -import { noEncodedPasswords } from '../rules/noEncodedPasswords' -import { noSpacesInFileNames } from '../rules/noSpacesInFileNames' -import { noTabIndentation } from '../rules/noTabIndentation' -import { noTrailingSpaces } from '../rules/noTrailingSpaces' -import { hasMacroNameInMend } from '../rules/hasMacroNameInMend' -import { noNestedMacros } from '../rules/noNestedMacros' -import { hasMacroParentheses } from '../rules/hasMacroParentheses' +import { + hasDoxygenHeader, + hasMacroNameInMend, + noNestedMacros, + hasMacroParentheses +} from '../rules/file' +import { + indentationMultiple, + maxLineLength, + noEncodedPasswords, + noTabIndentation, + noTrailingSpaces +} from '../rules/line' +import { lowerCaseFileNames, noSpacesInFileNames } from '../rules/path' import { FileLintRule, LineLintRule, PathLintRule } from './LintRule' /**