From d28d32d441c0a3885ec431d0ab9a073ed6c8f621 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Mon, 19 Apr 2021 21:07:24 +0100 Subject: [PATCH] fix(*): add SAS Macros section to Doxygen header --- jest.config.js | 2 +- src/format/formatText.spec.ts | 3 ++- src/rules/file/hasDoxygenHeader.spec.ts | 5 ++++- src/rules/file/hasDoxygenHeader.ts | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/jest.config.js b/jest.config.js index cecb39e..018b0ea 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,5 +9,5 @@ module.exports = { statements: -10 } }, - collectCoverageFrom: ['src/**/{!(index|example),}.ts'] + collectCoverageFrom: ['src/**/{!(index|formatExample|lintExample),}.ts'] } diff --git a/src/format/formatText.spec.ts b/src/format/formatText.spec.ts index 0263887..03b097b 100644 --- a/src/format/formatText.spec.ts +++ b/src/format/formatText.spec.ts @@ -18,6 +18,7 @@ describe('formatText', () => { const expectedOutput = `/** @file @brief +

SAS Macros

**/\n%macro test %put 'hello';\n%mend test;\n` @@ -39,7 +40,7 @@ describe('formatText', () => { ) const text = `%macro test\n %put 'hello';\r\n%mend; ` - const expectedOutput = `/**\r\n @file\r\n @brief \r\n**/\r\n%macro test\r\n %put 'hello';\r\n%mend test;\r\n` + const expectedOutput = `/**\r\n @file\r\n @brief \r\n

SAS Macros

\r\n**/\r\n%macro test\r\n %put 'hello';\r\n%mend test;\r\n` const output = await formatText(text) diff --git a/src/rules/file/hasDoxygenHeader.spec.ts b/src/rules/file/hasDoxygenHeader.spec.ts index 9f66a73..5cd2e2d 100644 --- a/src/rules/file/hasDoxygenHeader.spec.ts +++ b/src/rules/file/hasDoxygenHeader.spec.ts @@ -94,6 +94,7 @@ describe('hasDoxygenHeader', () => { `/** @file @brief +

SAS Macros

**/` + '\n' + content @@ -105,7 +106,9 @@ describe('hasDoxygenHeader', () => { const config = new LintConfig({ lineEndings: 'crlf' }) expect(hasDoxygenHeader.fix!(content, config)).toEqual( - `/**\r\n @file\r\n @brief \r\n**/` + '\r\n' + content + `/**\r\n @file\r\n @brief \r\n

SAS Macros

\r\n**/` + + '\r\n' + + content ) }) }) diff --git a/src/rules/file/hasDoxygenHeader.ts b/src/rules/file/hasDoxygenHeader.ts index b6635e6..2a5c75b 100644 --- a/src/rules/file/hasDoxygenHeader.ts +++ b/src/rules/file/hasDoxygenHeader.ts @@ -4,7 +4,7 @@ import { FileLintRule } from '../../types/LintRule' import { LintRuleType } from '../../types/LintRuleType' import { Severity } from '../../types/Severity' -const DoxygenHeader = `/**{lineEnding} @file{lineEnding} @brief {lineEnding}**/` +const DoxygenHeader = `/**{lineEnding} @file{lineEnding} @brief {lineEnding}

SAS Macros

{lineEnding}**/` const name = 'hasDoxygenHeader' const description =