@sasjs/lint 5.0.1 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -4
- package/package.json +1 -1
- package/rules/file/hasDoxygenHeader.js +113 -32
- package/rules/file/hasDoxygenHeader.js.map +1 -1
- package/rules/file/hasMacroNameInMend.js +2 -1
- package/rules/file/hasMacroNameInMend.js.map +1 -1
- package/rules/file/hasMacroParentheses.js +2 -1
- package/rules/file/hasMacroParentheses.js.map +1 -1
- package/rules/file/hasRequiredMacroOptions.js +2 -1
- package/rules/file/hasRequiredMacroOptions.js.map +1 -1
- package/rules/file/lineEndings.js +2 -1
- package/rules/file/lineEndings.js.map +1 -1
- package/rules/file/lowerCaseMacroNames.js +2 -1
- package/rules/file/lowerCaseMacroNames.js.map +1 -1
- package/rules/file/minMacroNameLength.js +2 -1
- package/rules/file/minMacroNameLength.js.map +1 -1
- package/rules/file/noMacroIfInOpenCode.js +2 -1
- package/rules/file/noMacroIfInOpenCode.js.map +1 -1
- package/rules/file/noNestedCommentsInHeader.js +2 -1
- package/rules/file/noNestedCommentsInHeader.js.map +1 -1
- package/rules/file/noNestedMacros.js +2 -1
- package/rules/file/noNestedMacros.js.map +1 -1
- package/rules/file/noSingleAsteriskComments.js +2 -1
- package/rules/file/noSingleAsteriskComments.js.map +1 -1
- package/rules/file/noUndeclaredMacros.js +20 -10
- package/rules/file/noUndeclaredMacros.js.map +1 -1
- package/rules/file/noUnusedLibnames.js +2 -1
- package/rules/file/noUnusedLibnames.js.map +1 -1
- package/rules/file/noUnusedMacros.js +2 -1
- package/rules/file/noUnusedMacros.js.map +1 -1
- package/rules/file/noXcmd.js +2 -1
- package/rules/file/noXcmd.js.map +1 -1
- package/rules/file/strictMacroDefinition.js +3 -2
- package/rules/file/strictMacroDefinition.js.map +1 -1
- package/rules/line/indentationMultiple.js +2 -1
- package/rules/line/indentationMultiple.js.map +1 -1
- package/rules/line/maxLineLength.js +2 -1
- package/rules/line/maxLineLength.js.map +1 -1
- package/rules/line/noBannedStrings.js +2 -1
- package/rules/line/noBannedStrings.js.map +1 -1
- package/rules/line/noEncodedPasswords.js +2 -1
- package/rules/line/noEncodedPasswords.js.map +1 -1
- package/rules/line/noGremlins.js +2 -1
- package/rules/line/noGremlins.js.map +1 -1
- package/rules/line/noTabs.js +4 -3
- package/rules/line/noTabs.js.map +1 -1
- package/rules/line/noTrailingSpaces.js +2 -1
- package/rules/line/noTrailingSpaces.js.map +1 -1
- package/rules/path/lowerCaseFileNames.js +2 -1
- package/rules/path/lowerCaseFileNames.js.map +1 -1
- package/rules/path/noSpacesInFileNames.js +2 -1
- package/rules/path/noSpacesInFileNames.js.map +1 -1
- package/sasjslint-schema.json +13 -3
- package/types/LintConfig.d.ts +7 -0
- package/types/LintConfig.js +12 -0
- package/types/LintConfig.js.map +1 -1
- package/utils/getSeverity.d.ts +17 -0
- package/utils/getSeverity.js +20 -0
- package/utils/getSeverity.js.map +1 -0
- package/utils/index.d.ts +2 -0
- package/utils/index.js +2 -0
- package/utils/index.js.map +1 -1
- package/utils/isDoxygenHeader.d.ts +17 -0
- package/utils/isDoxygenHeader.js +58 -0
- package/utils/isDoxygenHeader.js.map +1 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SAS Code linting and formatting
|
|
2
2
|
|
|
3
|
-
 [](https://github.com/sasjs/lint/issues?q=is%3Aissue+is%3Aclosed) [](https://github.com/sasjs/lint/issues) [](https://scorecard.dev/viewer/?uri=github.com/sasjs/lint)
|
|
3
|
+
 [](https://github.com/sasjs/lint/issues?q=is%3Aissue+is%3Aclosed) [](https://github.com/sasjs/lint/issues) [](https://scorecard.dev/viewer/?uri=github.com/sasjs/lint)
|
|
4
4
|
|
|
5
5
|
Our goal is to help SAS developers everywhere spend less time on code reviews, bug fixing and arguing about standards - and more time delivering extraordinary business value.
|
|
6
6
|
|
|
@@ -161,9 +161,9 @@ If creating a new value, use `{lineEnding}` instead of `\n`, eg as follows:
|
|
|
161
161
|
|
|
162
162
|
### hasDoxygenHeader
|
|
163
163
|
|
|
164
|
-
The SASjs framework recommends the use of Doxygen headers for describing all types of SAS program. This check identifies files where a Doxygen header does not begin on the first line, where it opens with a single asterisk,
|
|
164
|
+
The SASjs framework recommends the use of Doxygen headers for describing all types of SAS program. This check identifies files where a Doxygen header does not begin on the first line, where it opens with a single asterisk, where it closes with one, where the close shares its line with the header's content, and where the block is never closed. A header is located by its close: the line that holds nothing but `**/`, which is the form `sasjs compile` and this rule set read. A block opened with `/**` whose close sits at the end of a content line, or which has no close at all, is therefore not yet a header.
|
|
165
165
|
|
|
166
|
-
The closing half matters beyond style. This rule set and `sasjs compile` both locate the header's end by its `**/` terminator, so a header closed with a plain `*/` has no end they can find - a comment inside such a header can truncate it without being reported by [`noNestedCommentsInHeader`](#nonestedcommentsinheader). The fix widens the close marker to `**/`, which puts the header back where that check can see it. A header whose body already holds a comment opener is left alone: the first close marker may belong to that comment, and that decision belongs to the author.
|
|
166
|
+
The closing half matters beyond style. This rule set and `sasjs compile` both locate the header's end by its `**/` terminator, so a header closed with a plain `*/` has no end they can find - a comment inside such a header can truncate it without being reported by [`noNestedCommentsInHeader`](#nonestedcommentsinheader). The fix widens the close marker to `**/`, and moves a close that shares its line onto a line of its own, which puts the header back where that check can see it. The repairs are applied in sequence inside the rule's single fix call, so a header carrying more than one defect - `/* c */` needs its opener widened, its close widened and then moved - reaches the Doxygen form in one `sasjs lint fix` run. An unclosed block is reported but not rewritten: closing it at the end of the file would swallow whatever the author meant to keep outside it. A header whose body already holds a comment opener is left alone: the first close marker may belong to that comment, and that decision belongs to the author.
|
|
167
167
|
|
|
168
168
|
- Default: true
|
|
169
169
|
- Severity: WARNING
|
|
@@ -487,7 +487,7 @@ This will highlight lines with trailing spaces. Trailing spaces serve no useful
|
|
|
487
487
|
|
|
488
488
|
SASjs programs declare the macros they use in the `<h4> SAS Macros </h4>` section of the header, so that the compiler can assemble the job before it runs. This rule reports a warning for each macro that a file invokes without declaring it - either by defining it in the file, or by listing it in the `<h4> SAS Macros </h4>` section. That is the only header list `sasjs compile` reads, so it is the only one that makes a macro available to the job; entries anywhere else in the header do not count.
|
|
489
489
|
|
|
490
|
-
The rule only looks at a file that has a header
|
|
490
|
+
The rule only looks at a file that has a Doxygen header: a block comment that opens with `/**` and closes with a line holding nothing but `**/`. A file with no header has no `<h4> SAS Macros </h4>` section to declare a macro in, and the formatter cannot create one, so its calls are not reported - `hasDoxygenHeader` reports the missing header, and that is the change the file needs first. A leading comment that is not a header is skipped rather than reported against a fix that cannot write: that covers a comment which fits on one line, one opened with a single asterisk (`/* some comment */`), and a `/**` block whose close shares its line or never arrives. `hasDoxygenHeader` reports each of those shapes, and its fixes put the header into the form this rule can write into earlier in the same `sasjs lint fix` pass; an unclosed block has no safe automatic repair, so it is left for the author and the declarations are checked once it closes.
|
|
491
491
|
|
|
492
492
|
The macros that ship with SAS (`%scan`, `%index`, `%sysfunc` and the other macro functions, along with the macro language keywords such as `%if`, `%then` and `%do`) are always considered declared, so they are never reported. That list is generated from the `macroStatements` and `macroFunctions` groups of `@sasjs/sas-language` (`npm run generate:macros`), so it tracks the SAS language data rather than being maintained here. Macros made available through the `SASAUTOS` system option are not visible to the linter and will be reported - list them in [`ignoredMacros`](#ignoredmacros), which carries `webout` by default.
|
|
493
493
|
|
|
@@ -614,6 +614,36 @@ This setting allows the default severity to be adjusted. This is helpful when ru
|
|
|
614
614
|
- "warn" - show warning in the log (doesn’t affect exit code)
|
|
615
615
|
- "error" - show error in the log (exit code is 1 when triggered)
|
|
616
616
|
|
|
617
|
+
### severityLevel default
|
|
618
|
+
|
|
619
|
+
To fail on every warning without listing each rule, set the `default` entry.
|
|
620
|
+
It applies to every rule that has no entry of its own, including the rules added in later versions - so a new rule needs no `.sasjslint` change to be treated the same way as the rest.
|
|
621
|
+
|
|
622
|
+
```json
|
|
623
|
+
{
|
|
624
|
+
"severityLevel": {
|
|
625
|
+
"default": "error"
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
A rule named in the same object still wins over `default`, so an exception can be left as a warning:
|
|
631
|
+
|
|
632
|
+
```json
|
|
633
|
+
{
|
|
634
|
+
"severityLevel": {
|
|
635
|
+
"default": "error",
|
|
636
|
+
"maxLineLength": "warn"
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
The precedence is the rule's own entry, then `default`, then the severity built into the rule (`noEncodedPasswords` is an ERROR, the others are WARNING).
|
|
642
|
+
`default` accepts `"warn"` and `"error"`; any other value is an error, rather than being ignored.
|
|
643
|
+
|
|
644
|
+
Note this is the severity a violation is _reported_ at, which is what the exit code follows.
|
|
645
|
+
The `sasjs lint --fail-on warning` switch does the same thing for a single run without changing the configuration.
|
|
646
|
+
|
|
617
647
|
# SAS Formatter
|
|
618
648
|
|
|
619
649
|
A formatter will automatically apply rules when you hit SAVE, which can save a LOT of time.
|
package/package.json
CHANGED
|
@@ -7,52 +7,76 @@ const LintRuleType_1 = require("../../types/LintRuleType");
|
|
|
7
7
|
const Severity_1 = require("../../types/Severity");
|
|
8
8
|
const getLintConfig_1 = require("../../utils/getLintConfig");
|
|
9
9
|
const getPosition_1 = require("../../utils/getPosition");
|
|
10
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
10
11
|
const name = 'hasDoxygenHeader';
|
|
11
12
|
const description = 'Enforce a Doxygen header at the start of each file, in the /** ... **/ form.';
|
|
12
13
|
const message = 'File missing Doxygen header';
|
|
13
14
|
const messageForSingleAsterisk = 'File not following Doxygen header style, use double asterisks';
|
|
14
15
|
const messageForSingleAsteriskClose = 'File not following Doxygen header style, close with double asterisks';
|
|
16
|
+
const messageForCloseNotOnOwnLine = 'File not following Doxygen header style, close with the marker on a line of its own';
|
|
17
|
+
const messageForUnclosedHeader = 'File not following Doxygen header style, header is never closed';
|
|
15
18
|
const CLOSE = '*/';
|
|
16
19
|
/**
|
|
17
|
-
*
|
|
18
|
-
* asterisk, which is the closer half of the same style the opening check
|
|
19
|
-
* enforces.
|
|
20
|
+
* Locates the close of a header that opens at `start`.
|
|
20
21
|
*
|
|
21
22
|
* A header that holds a comment opener of its own is left alone: the first
|
|
22
23
|
* close marker may belong to that comment rather than to the header, and that
|
|
23
|
-
* ambiguity belongs to the author, not to a formatter.
|
|
24
|
-
*
|
|
25
|
-
* @returns the index of the close marker to widen, or `null`.
|
|
24
|
+
* ambiguity belongs to the author, not to a formatter. That is the only case
|
|
25
|
+
* that answers `null`.
|
|
26
26
|
*/
|
|
27
|
-
const
|
|
27
|
+
const findHeaderClose = (value, start) => {
|
|
28
28
|
const close = value.indexOf(CLOSE, start + 2);
|
|
29
29
|
if (close === -1)
|
|
30
|
-
return
|
|
31
|
-
// Already closed in the Doxygen form.
|
|
32
|
-
if (value[close - 1] === '*')
|
|
33
|
-
return null;
|
|
30
|
+
return { kind: 'none' };
|
|
34
31
|
// A comment opener before the close makes the extent ambiguous.
|
|
35
32
|
if (value.slice(start + 2, close).includes('/*'))
|
|
36
33
|
return null;
|
|
37
|
-
|
|
34
|
+
// A close written with one asterisk, which the fix widens.
|
|
35
|
+
if (value[close - 1] !== '*')
|
|
36
|
+
return { kind: 'single', index: close };
|
|
37
|
+
// `close` points at the second asterisk of the marker. The line holds nothing
|
|
38
|
+
// but the marker when the text before its first asterisk and after its slash
|
|
39
|
+
// is whitespace only.
|
|
40
|
+
const lineStart = value.lastIndexOf('\n', close - 1) + 1;
|
|
41
|
+
const lineEnd = value.indexOf('\n', close);
|
|
42
|
+
const before = value.slice(lineStart, close - 1);
|
|
43
|
+
const after = value.slice(close + 2, lineEnd === -1 ? value.length : lineEnd);
|
|
44
|
+
return before.trim() === '' && after.trim() === ''
|
|
45
|
+
? { kind: 'own-line', index: close }
|
|
46
|
+
: { kind: 'inline', index: close };
|
|
38
47
|
};
|
|
39
48
|
const diagnose = (value, config) => {
|
|
40
49
|
var _a;
|
|
41
|
-
const severity = (
|
|
50
|
+
const severity = (0, getSeverity_1.getSeverity)(config, name, Severity_1.Severity.Warning);
|
|
42
51
|
try {
|
|
43
52
|
const start = value.search(/\S/);
|
|
44
53
|
if (value.trimStart().startsWith('/**')) {
|
|
45
|
-
const close =
|
|
46
|
-
|
|
54
|
+
const close = findHeaderClose(value, start);
|
|
55
|
+
// The block's extent is ambiguous - leave it to the author.
|
|
56
|
+
if (close === null || close.kind === 'own-line')
|
|
47
57
|
return null;
|
|
48
|
-
|
|
58
|
+
if (close.kind === 'none') {
|
|
59
|
+
const { lineNumber, columnNumber } = (0, getPosition_1.getPosition)(value, start);
|
|
60
|
+
return {
|
|
61
|
+
message: messageForUnclosedHeader,
|
|
62
|
+
lineNumber,
|
|
63
|
+
startColumnNumber: columnNumber,
|
|
64
|
+
endColumnNumber: columnNumber + 3,
|
|
65
|
+
severity,
|
|
66
|
+
close: null
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const { lineNumber, columnNumber } = (0, getPosition_1.getPosition)(value, close.index);
|
|
70
|
+
const inline = close.kind === 'inline';
|
|
49
71
|
return {
|
|
50
|
-
message:
|
|
72
|
+
message: inline
|
|
73
|
+
? messageForCloseNotOnOwnLine
|
|
74
|
+
: messageForSingleAsteriskClose,
|
|
51
75
|
lineNumber,
|
|
52
76
|
startColumnNumber: columnNumber,
|
|
53
|
-
endColumnNumber: columnNumber + 1,
|
|
77
|
+
endColumnNumber: columnNumber + (inline ? 2 : 1),
|
|
54
78
|
severity,
|
|
55
|
-
close
|
|
79
|
+
close: close.index
|
|
56
80
|
};
|
|
57
81
|
}
|
|
58
82
|
const hasFileHeaderWithSingleAsterisk = value.trimStart().startsWith('/*');
|
|
@@ -63,7 +87,7 @@ const diagnose = (value, config) => {
|
|
|
63
87
|
startColumnNumber: 1,
|
|
64
88
|
endColumnNumber: 1,
|
|
65
89
|
severity,
|
|
66
|
-
close:
|
|
90
|
+
close: null
|
|
67
91
|
};
|
|
68
92
|
return {
|
|
69
93
|
message,
|
|
@@ -71,7 +95,7 @@ const diagnose = (value, config) => {
|
|
|
71
95
|
startColumnNumber: 1,
|
|
72
96
|
endColumnNumber: 1,
|
|
73
97
|
severity,
|
|
74
|
-
close:
|
|
98
|
+
close: null
|
|
75
99
|
};
|
|
76
100
|
}
|
|
77
101
|
catch (e) {
|
|
@@ -81,7 +105,7 @@ const diagnose = (value, config) => {
|
|
|
81
105
|
startColumnNumber: 1,
|
|
82
106
|
endColumnNumber: 1,
|
|
83
107
|
severity,
|
|
84
|
-
close:
|
|
108
|
+
close: null
|
|
85
109
|
};
|
|
86
110
|
}
|
|
87
111
|
};
|
|
@@ -99,23 +123,80 @@ const test = (value, config) => {
|
|
|
99
123
|
}
|
|
100
124
|
];
|
|
101
125
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Puts a close marker on a line of its own, moving any text that followed the
|
|
128
|
+
* marker onto the next line. A close that overlaps the opener - an empty
|
|
129
|
+
* comment - has no body to keep, so the whole block is rewritten.
|
|
130
|
+
*
|
|
131
|
+
* `close` is the index of the second asterisk of the marker, as `indexOf` finds
|
|
132
|
+
* it, so the marker itself starts one character earlier.
|
|
133
|
+
*/
|
|
134
|
+
const expandClose = (value, close, start) => {
|
|
135
|
+
const lineEnding = value.includes('\r\n') ? '\r\n' : '\n';
|
|
136
|
+
if (close <= start + 2) {
|
|
137
|
+
return `${value.slice(0, start)}/**${lineEnding}**/${value.slice(close + 2)}`;
|
|
138
|
+
}
|
|
139
|
+
const markerStart = close - 1;
|
|
140
|
+
const head = value.slice(0, markerStart).replace(/[ \t]+$/, '');
|
|
141
|
+
const lineEnd = value.indexOf('\n', close);
|
|
142
|
+
const after = value.slice(close + 2, lineEnd === -1 ? value.length : lineEnd);
|
|
143
|
+
if (after.trim() === '')
|
|
144
|
+
return `${head}${lineEnding}${value.slice(markerStart)}`;
|
|
145
|
+
const rest = value.slice(lineEnd === -1 ? value.length : lineEnd);
|
|
146
|
+
return `${head}${lineEnding}${value.slice(markerStart, close + 2)}${lineEnding}${after.trimStart()}${rest}`;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Applies the repair a diagnosis calls for, or returns the text unchanged when
|
|
150
|
+
* it has none. `hasDoxygenHeader` repairs one defect per call so that the
|
|
151
|
+
* diagnosis and the repair cannot drift apart; `fix` below keeps calling it
|
|
152
|
+
* until the header is clean.
|
|
153
|
+
*/
|
|
154
|
+
const repair = (value, diagnosis, config) => {
|
|
106
155
|
if (diagnosis.message == messageForSingleAsterisk)
|
|
107
156
|
return value.replace('/*', '/**');
|
|
108
157
|
if (diagnosis.message == messageForSingleAsteriskClose)
|
|
109
158
|
return `${value.slice(0, diagnosis.close)}*${value.slice(diagnosis.close)}`;
|
|
110
|
-
|
|
111
|
-
|
|
159
|
+
if (diagnosis.message == messageForCloseNotOnOwnLine)
|
|
160
|
+
return expandClose(value, diagnosis.close, value.search(/\S/));
|
|
161
|
+
// An unclosed header has no safe repair: closing it at the end of the file
|
|
162
|
+
// would swallow whatever the author meant to keep outside it. The warning
|
|
163
|
+
// stays for the author to resolve.
|
|
164
|
+
if (diagnosis.message == messageForUnclosedHeader)
|
|
165
|
+
return value;
|
|
166
|
+
const cfg = config || new types_1.LintConfig(getLintConfig_1.DefaultLintConfiguration);
|
|
167
|
+
const lineEndingConfig = (cfg === null || cfg === void 0 ? void 0 : cfg.lineEndings) || LineEndings_1.LineEndings.LF;
|
|
112
168
|
const lineEnding = lineEndingConfig === LineEndings_1.LineEndings.LF ? '\n' : '\r\n';
|
|
113
|
-
return `${
|
|
169
|
+
return `${cfg === null || cfg === void 0 ? void 0 : cfg.defaultHeader.replace(/{lineEnding}/g, lineEnding)}${lineEnding}${value}`;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Repairs a header until it is clean, or until a repair stops changing the
|
|
173
|
+
* text.
|
|
174
|
+
*
|
|
175
|
+
* One header can hold more than one defect, and the formatter calls a rule's
|
|
176
|
+
* `fix` once per pass - a single-line comment in the single-asterisk form needs
|
|
177
|
+
* the opener widened, the close widened, and then the close moved onto a line
|
|
178
|
+
* of its own. Repairing a single defect leaves the file warning again after the
|
|
179
|
+
* pass, and leaves `noUndeclaredMacros` switched off for it, so the remaining
|
|
180
|
+
* repairs are taken here. Each repair moves the header strictly closer to the
|
|
181
|
+
* target shape, and the bound stops a repair that somehow does not.
|
|
182
|
+
*/
|
|
183
|
+
const fix = (value, config) => {
|
|
184
|
+
let repaired = value;
|
|
185
|
+
for (let step = 0; step < 3; step++) {
|
|
186
|
+
const diagnosis = diagnose(repaired, config);
|
|
187
|
+
if (!diagnosis)
|
|
188
|
+
return repaired;
|
|
189
|
+
const next = repair(repaired, diagnosis, config);
|
|
190
|
+
if (next === repaired)
|
|
191
|
+
return repaired;
|
|
192
|
+
repaired = next;
|
|
193
|
+
}
|
|
194
|
+
return repaired;
|
|
114
195
|
};
|
|
115
196
|
// Lint rule that checks for a Doxygen header in the double-asterisk form at the
|
|
116
|
-
// start of a given file: the opening check, the closing
|
|
117
|
-
//
|
|
118
|
-
//
|
|
197
|
+
// start of a given file: the opening check, the closing checks (one asterisk,
|
|
198
|
+
// a close that shares its line, and a block that never closes), and the fixes
|
|
199
|
+
// that widen a single-asterisk close or move a close onto a line of its own.
|
|
119
200
|
exports.hasDoxygenHeader = {
|
|
120
201
|
type: LintRuleType_1.LintRuleType.File,
|
|
121
202
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasDoxygenHeader.js","sourceRoot":"","sources":["../../../src/rules/file/hasDoxygenHeader.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AACpD,yDAAqD;AAErD,2DAAuD;AACvD,mDAA+C;AAC/C,6DAAoE;AACpE,yDAAqD;AAErD,MAAM,IAAI,GAAG,kBAAkB,CAAA;AAC/B,MAAM,WAAW,GACf,8EAA8E,CAAA;AAChF,MAAM,OAAO,GAAG,6BAA6B,CAAA;AAC7C,MAAM,wB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AC9E,8EAA8E;AAC9E,6EAA6E;AAChE,QAAA,gBAAgB,GAAiB;IAC5C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
|
@@ -7,13 +7,14 @@ const getColumnNumber_1 = require("../../utils/getColumnNumber");
|
|
|
7
7
|
const LineEndings_1 = require("../../types/LineEndings");
|
|
8
8
|
const parseMacros_1 = require("../../utils/parseMacros");
|
|
9
9
|
const splitLines_1 = require("../../utils/splitLines");
|
|
10
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
10
11
|
const name = 'hasMacroNameInMend';
|
|
11
12
|
const description = 'Enforces the presence of the macro name in each %mend statement.';
|
|
12
13
|
const message = '%mend statement has missing or incorrect macro name';
|
|
13
14
|
const test = (value, config) => {
|
|
14
15
|
const lines = (0, splitLines_1.splitLines)(value);
|
|
15
16
|
const macros = (0, parseMacros_1.parseMacros)(value, config);
|
|
16
|
-
const severity = (
|
|
17
|
+
const severity = (0, getSeverity_1.getSeverity)(config, name, Severity_1.Severity.Warning);
|
|
17
18
|
const diagnostics = [];
|
|
18
19
|
macros.forEach((macro) => {
|
|
19
20
|
if (macro.startLineNumbers.length === 0 && macro.endLineNumber !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasMacroNameInMend.js","sourceRoot":"","sources":["../../../src/rules/file/hasMacroNameInMend.ts"],"names":[],"mappings":";;;AAEA,2DAAuD;AACvD,mDAA+C;AAC/C,iEAA6D;AAE7D,yDAAqD;AACrD,yDAAqD;AACrD,uDAAmD;
|
|
1
|
+
{"version":3,"file":"hasMacroNameInMend.js","sourceRoot":"","sources":["../../../src/rules/file/hasMacroNameInMend.ts"],"names":[],"mappings":";;;AAEA,2DAAuD;AACvD,mDAA+C;AAC/C,iEAA6D;AAE7D,yDAAqD;AACrD,yDAAqD;AACrD,uDAAmD;AACnD,yDAAqD;AAErD,MAAM,IAA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A;YAE9D,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,GAAG,CAAC,CAAC,CAAA;YAC/D,0EAA0E;YAC1E,QAAQ;YACR,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;YACrD,KAAK,CAAE,KAAK,CAAC,aAAwB,GAAG,CAAC,CAAC;gBACxC,eAAe,GAAG,GAAG,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE,GAAG,cAAc,CAAA;QACjE,CAAC;IACH,CAAC,CAAC,CAAA;IACF,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAE5C,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAED;;GAEG;AACU,QAAA,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
|
@@ -5,13 +5,14 @@ const LintRuleType_1 = require("../../types/LintRuleType");
|
|
|
5
5
|
const Severity_1 = require("../../types/Severity");
|
|
6
6
|
const getColumnNumber_1 = require("../../utils/getColumnNumber");
|
|
7
7
|
const parseMacros_1 = require("../../utils/parseMacros");
|
|
8
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
8
9
|
const name = 'hasMacroParentheses';
|
|
9
10
|
const description = 'Enforces the presence of parentheses in macro definitions.';
|
|
10
11
|
const message = 'Macro definition missing parentheses';
|
|
11
12
|
const test = (value, config) => {
|
|
12
13
|
const diagnostics = [];
|
|
13
14
|
const macros = (0, parseMacros_1.parseMacros)(value, config);
|
|
14
|
-
const severity = (
|
|
15
|
+
const severity = (0, getSeverity_1.getSeverity)(config, name, Severity_1.Severity.Warning);
|
|
15
16
|
macros.forEach((macro) => {
|
|
16
17
|
if (!macro.name) {
|
|
17
18
|
diagnostics.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasMacroParentheses.js","sourceRoot":"","sources":["../../../src/rules/file/hasMacroParentheses.ts"],"names":[],"mappings":";;;AAEA,2DAAuD;AACvD,mDAA+C;AAC/C,iEAA6D;AAC7D,yDAAqD;
|
|
1
|
+
{"version":3,"file":"hasMacroParentheses.js","sourceRoot":"","sources":["../../../src/rules/file/hasMacroParentheses.ts"],"names":[],"mappings":";;;AAEA,2DAAuD;AACvD,mDAA+C;AAC/C,iEAA6D;AAC7D,yDAAqD;AAErD,yDAAqD;AAErD,MAAM,IAAI,GAAG,qBAAqB,CAAA;AAClC,MAAM,WAAW,GAAG,4DAA4D,CAAA;AAChF,MAAM,OAAO,GAAG,sCAAsC,CAAA;AAEtD,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,MAAmB,EAAE,EAAE;IAClD,MAAM,WAAW,GAAiB,EAAE,CAAA;IACpC,MAAM,MAAM,GAAG,IAAA,yBAAW,EAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IACzC,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,mBAAQ,CAAC,OAAO,CAAC,CAAA;IAE5D,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC;gBACf,OAAO,EAAE,+BAA+B;gBACxC,UAAU,EAAE,KAAK,CAAC,gBAAiB,CAAC,CAAC,CAAC;gBACtC,iBAAiB,EAAE,IAAA,iCAAe,EAChC,KAAK,CAAC,gBAAiB,CAAC,CAAC,CAAC,EAC1B,QAAQ,EACR,IAAI,CACL;gBACD,wEAAwE;gBACxE,yBAAyB;gBACzB,eAAe,EACb,IAAA,iCAAe,EAAC,KAAK,CAAC,gBAAiB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;oBAC3D,KAAK,CAAC,WAAW,CAAC,MAAM;oBACxB,CAAC;gBACH,QAAQ;aACT,CAAC,CAAA;QACJ,CAAC;aAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAClE,MAAM,kBAAkB,GAAG,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,CACjE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CACxB,CAAA;YACD,WAAW,CAAC,IAAI,CAAC;gBACf,OAAO;gBACP,UAAU,EAAE,KAAK,CAAC,gBAAiB,CAAC,kBAAkB,CAAC;gBACvD,iBAAiB,EAAE,IAAA,iCAAe,EAChC,KAAK,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAC1C,KAAK,CAAC,IAAI,CACX;gBACD,eAAe,EACb,IAAA,iCAAe,EACb,KAAK,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAC1C,KAAK,CAAC,IAAI,CACX;oBACD,KAAK,CAAC,IAAI,CAAC,MAAM;oBACjB,CAAC;gBACH,QAAQ;aACT,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAED;;GAEG;AACU,QAAA,mBAAmB,GAAiB;IAC/C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;CACL,CAAA"}
|
|
@@ -4,13 +4,14 @@ exports.hasRequiredMacroOptions = void 0;
|
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
const LintRuleType_1 = require("../../types/LintRuleType");
|
|
6
6
|
const parseMacros_1 = require("../../utils/parseMacros");
|
|
7
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
7
8
|
const name = 'hasRequiredMacroOptions';
|
|
8
9
|
const description = 'Enforce required macro options';
|
|
9
10
|
const message = 'Macro defined without required options';
|
|
10
11
|
const processOptions = (macro, diagnostics, config) => {
|
|
11
12
|
var _a, _b, _c;
|
|
12
13
|
const optionsPresent = (_c = (_b = (_a = macro.declaration.split('/')) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';
|
|
13
|
-
const severity = (
|
|
14
|
+
const severity = (0, getSeverity_1.getSeverity)(config, name, types_1.Severity.Warning);
|
|
14
15
|
config === null || config === void 0 ? void 0 : config.requiredMacroOptions.forEach((option) => {
|
|
15
16
|
if (!optionsPresent.includes(option)) {
|
|
16
17
|
diagnostics.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasRequiredMacroOptions.js","sourceRoot":"","sources":["../../../src/rules/file/hasRequiredMacroOptions.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AAErE,2DAAuD;AACvD,yDAAqD;AAErD,MAAM,IAAI,GAAG,yBAAyB,CAAA;AACtC,MAAM,WAAW,GAAG,gCAAgC,CAAA;AACpD,MAAM,OAAO,GAAG,wCAAwC,CAAA;AAExD,MAAM,cAAc,GAAG,CACrB,KAAY,EACZ,WAAyB,EACzB,MAAmB,EACb,EAAE;;IACR,MAAM,cAAc,GAAG,MAAA,MAAA,MAAA,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,0CAAE,IAAI,EAAE,mCAAI,EAAE,CAAA;IACtE,MAAM,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"hasRequiredMacroOptions.js","sourceRoot":"","sources":["../../../src/rules/file/hasRequiredMacroOptions.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AAErE,2DAAuD;AACvD,yDAAqD;AACrD,yDAAqD;AAErD,MAAM,IAAI,GAAG,yBAAyB,CAAA;AACtC,MAAM,WAAW,GAAG,gCAAgC,CAAA;AACpD,MAAM,OAAO,GAAG,wCAAwC,CAAA;AAExD,MAAM,cAAc,GAAG,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AAA"}
|
|
@@ -4,6 +4,7 @@ exports.lineEndings = void 0;
|
|
|
4
4
|
const LineEndings_1 = require("../../types/LineEndings");
|
|
5
5
|
const LintRuleType_1 = require("../../types/LintRuleType");
|
|
6
6
|
const Severity_1 = require("../../types/Severity");
|
|
7
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
7
8
|
const name = 'lineEndings';
|
|
8
9
|
const description = 'Ensures every line, including the last, ends with the configured line ending.';
|
|
9
10
|
const message = 'Incorrect line ending - {actual} instead of {expected}';
|
|
@@ -17,7 +18,7 @@ const test = (value, config) => {
|
|
|
17
18
|
.replace(/\n/g, '{lf}')
|
|
18
19
|
.split(new RegExp(`(?<=${expectedLineEnding})`));
|
|
19
20
|
const diagnostics = [];
|
|
20
|
-
const severity = (
|
|
21
|
+
const severity = (0, getSeverity_1.getSeverity)(config, name, Severity_1.Severity.Warning);
|
|
21
22
|
let indexOffset = 0;
|
|
22
23
|
lines.forEach((line, index) => {
|
|
23
24
|
if (line.endsWith(incorrectLineEnding)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineEndings.js","sourceRoot":"","sources":["../../../src/rules/file/lineEndings.ts"],"names":[],"mappings":";;;AACA,yDAAqD;AAErD,2DAAuD;AACvD,mDAA+C;
|
|
1
|
+
{"version":3,"file":"lineEndings.js","sourceRoot":"","sources":["../../../src/rules/file/lineEndings.ts"],"names":[],"mappings":";;;AACA,yDAAqD;AAErD,2DAAuD;AACvD,mDAA+C;AAC/C,yDAAqD;AAErD,MAAM,IAAI,GAAG,aAAa,CAAA;AAC1B,MAAM,WAAW,GACf,+EAA+E,CAAA;AACjF,MAAM,OAAO,GAAG,wDAAwD,CAAA;AACxE,MAAM,cAAc,GAAG,iDAAiD,CAAA;AAExE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,MAAmB,EAAE,EAAE;IAClD,MAAM,gBAAgB,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,KAA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C,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACpE,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO,SAAS,GAAG,iBAAiB,CAAA;AACtC,CAAC,CAAA;AAED;;;GAGG;AACU,QAAA,WAAW,GAAiB;IACvC,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
|
@@ -8,6 +8,7 @@ const LineEndings_1 = require("../../types/LineEndings");
|
|
|
8
8
|
const headerMacros_1 = require("../../utils/headerMacros");
|
|
9
9
|
const parseMacros_1 = require("../../utils/parseMacros");
|
|
10
10
|
const splitText_1 = require("../../utils/splitText");
|
|
11
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
11
12
|
const name = 'lowerCaseMacroNames';
|
|
12
13
|
const description = 'Enforce lower case macro names, in the <h4> SAS Macros </h4> header and in the %macro definition.';
|
|
13
14
|
const message = `Macro name '{macro}' contains uppercase characters`;
|
|
@@ -34,7 +35,7 @@ const test = (value, config) => {
|
|
|
34
35
|
if (!value)
|
|
35
36
|
return [];
|
|
36
37
|
const cfg = config || new types_1.LintConfig();
|
|
37
|
-
const severity = cfg
|
|
38
|
+
const severity = (0, getSeverity_1.getSeverity)(cfg, name, Severity_1.Severity.Warning);
|
|
38
39
|
const diagnostics = [];
|
|
39
40
|
(0, headerMacros_1.getHeaderMacros)(value, cfg).forEach((macro) => {
|
|
40
41
|
if (macro.name === macro.name.toLowerCase())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowerCaseMacroNames.js","sourceRoot":"","sources":["../../../src/rules/file/lowerCaseMacroNames.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,yDAAqD;AACrD,2DAA0D;AAC1D,yDAAqD;AACrD,qDAAiD;
|
|
1
|
+
{"version":3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AAW,EAAE;QAAE,OAAM;IAE/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9B,KAAK,CAAC,KAAK,CAAC;QACV,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;YACpB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE;YAC3D,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AAC1C,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,QAAQ,GAAG,CACf,IAAY,EACZ,GAAW,EAC+B,EAAE;IAC5C,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACtE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IAElE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAA;AACpC,CAAC,CAAA;AAED;;;;GAIG;AACU,QAAA,mBAAmB,GAAiB;IAC/C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
|
@@ -8,6 +8,7 @@ const utils_1 = require("../../utils");
|
|
|
8
8
|
const getColumnNumber_1 = require("../../utils/getColumnNumber");
|
|
9
9
|
const parseMacros_1 = require("../../utils/parseMacros");
|
|
10
10
|
const splitLines_1 = require("../../utils/splitLines");
|
|
11
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
11
12
|
const name = 'minMacroNameLength';
|
|
12
13
|
const description = 'Ensure a macro name is long enough not to collide with another language.';
|
|
13
14
|
const message = `Macro name '{macro}' is shorter than {length} characters`;
|
|
@@ -52,7 +53,7 @@ const inComment = (line, index) => {
|
|
|
52
53
|
};
|
|
53
54
|
const test = (value, config) => {
|
|
54
55
|
var _a;
|
|
55
|
-
const severity = (
|
|
56
|
+
const severity = (0, getSeverity_1.getSeverity)(config, name, Severity_1.Severity.Warning);
|
|
56
57
|
const minimum = (_a = config === null || config === void 0 ? void 0 : config.minMacroNameLength) !== null && _a !== void 0 ? _a : 3;
|
|
57
58
|
// A floor below two characters switches the rule off, the way a zero
|
|
58
59
|
// `maxLineLength` switches its rule off.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minMacroNameLength.js","sourceRoot":"","sources":["../../../src/rules/file/minMacroNameLength.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,uCAIoB;AACpB,iEAA6D;AAC7D,yDAAqD;AACrD,uDAAmD;
|
|
1
|
+
{"version":3,"file":"minMacroNameLength.js","sourceRoot":"","sources":["../../../src/rules/file/minMacroNameLength.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,uCAIoB;AACpB,iEAA6D;AAC7D,yDAAqD;AACrD,uDAAmD;AACnD,yDAAqD;AAErD,MAAM,IAAI,GAAG,oBAAoB,CAAA;AACjC,MAAM,WAAW,GACf,0EAA0E,CAAA;AAC5E,MAAM,OAAO,GAAG,0DAA0D,CAAA;AAE1E;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IACpC,MAAM,KAAK,GAAuB,EAAE,CAAA;IACpC,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,KAAK,GAAG,CAAC,CAAC,CAAA;IAEd,KAAK,IAAI,KAAK,GAAG,CAAC,EA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AAM,GAAG,CAAC;YAC3C,QAAQ;SACT,CAAA;IACH,CAAC,CAAC,CACL,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;;GAUG;AACU,QAAA,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;CACL,CAAA"}
|
|
@@ -6,6 +6,7 @@ const LintRuleType_1 = require("../../types/LintRuleType");
|
|
|
6
6
|
const Severity_1 = require("../../types/Severity");
|
|
7
7
|
const parseMacroCalls_1 = require("../../utils/parseMacroCalls");
|
|
8
8
|
const parseMacros_1 = require("../../utils/parseMacros");
|
|
9
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
9
10
|
const name = 'noMacroIfInOpenCode';
|
|
10
11
|
const description = 'Reports %if used in open code, which requires SAS 9.4M5.';
|
|
11
12
|
const message = `Macro %if used in open code - open-code %if requires SAS 9.4M5; move the block inside a %macro definition`;
|
|
@@ -52,7 +53,7 @@ const test = (value, config) => {
|
|
|
52
53
|
if (!value)
|
|
53
54
|
return [];
|
|
54
55
|
const cfg = config || new types_1.LintConfig();
|
|
55
|
-
const severity = cfg
|
|
56
|
+
const severity = (0, getSeverity_1.getSeverity)(cfg, name, Severity_1.Severity.Warning);
|
|
56
57
|
const spans = getMacroSpans(value, cfg);
|
|
57
58
|
return (0, parseMacroCalls_1.parseMacroCalls)(value, cfg)
|
|
58
59
|
.filter((call) => call.name.toLowerCase() === 'if' && !call.quoted)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noMacroIfInOpenCode.js","sourceRoot":"","sources":["../../../src/rules/file/noMacroIfInOpenCode.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,iEAA6D;AAC7D,yDAAqD;AAErD,MAAM,IAAI,GAAG,qBAAqB,CAAA;AAClC,MAAM,WAAW,GAAG,0DAA0D,CAAA;AAC9E,MAAM,OAA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EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;SAClE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACd,OAAO;QACP,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,QAAQ;KACT,CAAC,CAAC,CAAA;AACP,CAAC,CAAA;AAED;;;;;;;;GAQG;AACU,QAAA,mBAAmB,GAAiB;IAC/C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;CACL,CAAA"}
|
|
@@ -4,6 +4,7 @@ exports.noNestedCommentsInHeader = void 0;
|
|
|
4
4
|
const LintRuleType_1 = require("../../types/LintRuleType");
|
|
5
5
|
const Severity_1 = require("../../types/Severity");
|
|
6
6
|
const getPosition_1 = require("../../utils/getPosition");
|
|
7
|
+
const getSeverity_1 = require("../../utils/getSeverity");
|
|
7
8
|
const name = 'noNestedCommentsInHeader';
|
|
8
9
|
const description = 'Disallow a close marker inside the Doxygen header. SAS block comments do not nest and end at the first close marker, so anything after one in the header is compiled as SAS. The header end is identified by its `**/` terminator standing alone on its line, so a project that closes headers with a plain close marker is not inspected.';
|
|
9
10
|
const message = 'Doxygen header contains a nested block comment';
|
|
@@ -58,7 +59,7 @@ const ownTerminator = (value, close) => {
|
|
|
58
59
|
* build on this shape and the other way round.
|
|
59
60
|
*/
|
|
60
61
|
const test = (value, config) => {
|
|
61
|
-
const severity = (
|
|
62
|
+
const severity = (0, getSeverity_1.getSeverity)(config, name, Severity_1.Severity.Warning);
|
|
62
63
|
if (!value)
|
|
63
64
|
return [];
|
|
64
65
|
const start = value.search(/\S/);
|