@sasjs/lint 4.6.0 → 4.7.0
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 +25 -0
- package/package.json +4 -1
- package/rules/file/index.d.ts +1 -0
- package/rules/file/index.js +3 -1
- package/rules/file/index.js.map +1 -1
- package/rules/file/noMacroIfInOpenCode.d.ts +11 -0
- package/rules/file/noMacroIfInOpenCode.js +84 -0
- package/rules/file/noMacroIfInOpenCode.js.map +1 -0
- package/rules/file/noUndeclaredMacros.js +35 -0
- package/rules/file/noUndeclaredMacros.js.map +1 -1
- package/sasjslint-schema.json +17 -0
- package/types/LintConfig.js +6 -0
- package/types/LintConfig.js.map +1 -1
- package/utils/getLintConfig.d.ts +1 -0
- package/utils/getLintConfig.js +1 -0
- package/utils/getLintConfig.js.map +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ Configuration is via a `.sasjslint` file with the following structure (these are
|
|
|
41
41
|
"noBannedStrings": true,
|
|
42
42
|
"noEncodedPasswords": true,
|
|
43
43
|
"noGremlins": true,
|
|
44
|
+
"noMacroIfInOpenCode": false,
|
|
44
45
|
"noNestedCommentsInHeader": true,
|
|
45
46
|
"noNestedMacros": true,
|
|
46
47
|
"noSingleAsteriskComments": false,
|
|
@@ -370,6 +371,30 @@ The list of characters can be found in this file: [https://github.com/sasjs/lint
|
|
|
370
371
|
- Default: true
|
|
371
372
|
- Severity: WARNING
|
|
372
373
|
|
|
374
|
+
### noMacroIfInOpenCode
|
|
375
|
+
|
|
376
|
+
`%if-%then-%else` in open code is a SAS 9.4M5 feature. On an earlier maintenance SAS rejects the statement outright - "ERROR: The %IF statement is not valid in open code" - so a program that uses one cannot run below that floor, while the same logic wrapped in a macro can. At M5 the `%then` / `%else` clause has to be a `%do` / `%end` block, so the construct worth removing is the `%if ... %then %do; ... %end;` block.
|
|
377
|
+
|
|
378
|
+
This rule reports a warning for each `%if` that runs in open code - that is, outside every `%macro` definition in the file. A `%if` inside a definition is silent. The scan skips the regions the other macro rules skip: block comments, macro comments (`%* ... ;`), comment statements, `datalines` / `cards` sections, `proc lua` / `proc groovy` submit blocks and the argument of `%str` / `%nrstr`. A `%if` inside a single-quoted string is not reported, because SAS resolves no macro trigger there; one inside a double-quoted string is reported, because SAS does resolve triggers there and the statement the string generates still runs on the target session.
|
|
379
|
+
|
|
380
|
+
The rule is **off by default**: it encodes a release floor, so it applies to the projects whose floor is earlier than 9.4M5. Enable it per project with `"noMacroIfInOpenCode": true`, or for one file in its `@sasjslint` header block:
|
|
381
|
+
|
|
382
|
+
```sas
|
|
383
|
+
/**
|
|
384
|
+
@file
|
|
385
|
+
@brief Loads the settlement feed
|
|
386
|
+
|
|
387
|
+
@sasjslint {"noMacroIfInOpenCode": true}
|
|
388
|
+
**/
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
There is no fix. Moving a block into a macro means writing a `%macro` / `%mend` pair and an invocation around code the formatter cannot reorder, and an invented macro name is worse than the warning that points at the block.
|
|
392
|
+
|
|
393
|
+
Two boundaries are deliberate. A definition with no `%mend` reads to the end of the file, because SAS reads it as the macro body, so a `%if` after such a declaration is not reported. And a `%if` written on the same line as the `%mend` that closes a definition is read as part of that definition.
|
|
394
|
+
|
|
395
|
+
- Default: false
|
|
396
|
+
- Severity: WARNING
|
|
397
|
+
|
|
373
398
|
### noNestedCommentsInHeader
|
|
374
399
|
|
|
375
400
|
A doxygen header is a SAS block comment, and SAS block comments do not nest: the first close marker ends the comment. A `/* ... */` inside the header therefore closes the header early, and the rest of it - `@param` lines, and any code in a usage example - is compiled as SAS. Header text that holds `/*/`, such as a glob like `src/*/file.sas`, ends the header the same way.
|
package/package.json
CHANGED
package/rules/file/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { hasMacroNameInMend } from './hasMacroNameInMend';
|
|
|
3
3
|
export { hasMacroParentheses } from './hasMacroParentheses';
|
|
4
4
|
export { lineEndings } from './lineEndings';
|
|
5
5
|
export { minMacroNameLength } from './minMacroNameLength';
|
|
6
|
+
export { noMacroIfInOpenCode } from './noMacroIfInOpenCode';
|
|
6
7
|
export { noNestedCommentsInHeader } from './noNestedCommentsInHeader';
|
|
7
8
|
export { noNestedMacros } from './noNestedMacros';
|
|
8
9
|
export { noUndeclaredMacros } from './noUndeclaredMacros';
|
package/rules/file/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.noSingleAsteriskComments = exports.hasRequiredMacroOptions = exports.strictMacroDefinition = exports.noUnusedLibnames = exports.noUnusedMacros = exports.noUndeclaredMacros = exports.noNestedMacros = exports.noNestedCommentsInHeader = exports.minMacroNameLength = exports.lineEndings = exports.hasMacroParentheses = exports.hasMacroNameInMend = exports.hasDoxygenHeader = void 0;
|
|
3
|
+
exports.noSingleAsteriskComments = exports.hasRequiredMacroOptions = exports.strictMacroDefinition = exports.noUnusedLibnames = exports.noUnusedMacros = exports.noUndeclaredMacros = exports.noNestedMacros = exports.noNestedCommentsInHeader = exports.noMacroIfInOpenCode = exports.minMacroNameLength = exports.lineEndings = exports.hasMacroParentheses = exports.hasMacroNameInMend = exports.hasDoxygenHeader = void 0;
|
|
4
4
|
var hasDoxygenHeader_1 = require("./hasDoxygenHeader");
|
|
5
5
|
Object.defineProperty(exports, "hasDoxygenHeader", { enumerable: true, get: function () { return hasDoxygenHeader_1.hasDoxygenHeader; } });
|
|
6
6
|
var hasMacroNameInMend_1 = require("./hasMacroNameInMend");
|
|
@@ -11,6 +11,8 @@ var lineEndings_1 = require("./lineEndings");
|
|
|
11
11
|
Object.defineProperty(exports, "lineEndings", { enumerable: true, get: function () { return lineEndings_1.lineEndings; } });
|
|
12
12
|
var minMacroNameLength_1 = require("./minMacroNameLength");
|
|
13
13
|
Object.defineProperty(exports, "minMacroNameLength", { enumerable: true, get: function () { return minMacroNameLength_1.minMacroNameLength; } });
|
|
14
|
+
var noMacroIfInOpenCode_1 = require("./noMacroIfInOpenCode");
|
|
15
|
+
Object.defineProperty(exports, "noMacroIfInOpenCode", { enumerable: true, get: function () { return noMacroIfInOpenCode_1.noMacroIfInOpenCode; } });
|
|
14
16
|
var noNestedCommentsInHeader_1 = require("./noNestedCommentsInHeader");
|
|
15
17
|
Object.defineProperty(exports, "noNestedCommentsInHeader", { enumerable: true, get: function () { return noNestedCommentsInHeader_1.noNestedCommentsInHeader; } });
|
|
16
18
|
var noNestedMacros_1 = require("./noNestedMacros");
|
package/rules/file/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/file/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/file/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FileLintRule } from '../../types/LintRule';
|
|
2
|
+
/**
|
|
3
|
+
* Lint rule that reports `%if` used in open code.
|
|
4
|
+
*
|
|
5
|
+
* Enable it with `"noMacroIfInOpenCode": true` where the SAS floor is earlier
|
|
6
|
+
* than 9.4 Maintenance 5, which is the release that added `%if-%then-%else` in
|
|
7
|
+
* open code. At M5 the `%then` / `%else` clause must be a `%do` / `%end` block,
|
|
8
|
+
* so the construct this rule removes is the `%if ... %then %do; ... %end;`
|
|
9
|
+
* block that cannot run below that floor.
|
|
10
|
+
*/
|
|
11
|
+
export declare const noMacroIfInOpenCode: FileLintRule;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.noMacroIfInOpenCode = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const LintRuleType_1 = require("../../types/LintRuleType");
|
|
6
|
+
const Severity_1 = require("../../types/Severity");
|
|
7
|
+
const parseMacroCalls_1 = require("../../utils/parseMacroCalls");
|
|
8
|
+
const parseMacros_1 = require("../../utils/parseMacros");
|
|
9
|
+
const name = 'noMacroIfInOpenCode';
|
|
10
|
+
const description = 'Reports %if used in open code, which requires SAS 9.4M5.';
|
|
11
|
+
const message = `Macro %if used in open code - open-code %if requires SAS 9.4M5; move the block inside a %macro definition`;
|
|
12
|
+
const getMacroSpans = (value, config) => (0, parseMacros_1.parseMacros)(value, config)
|
|
13
|
+
// An orphan `%mend` carries no start line, so it declares no definition.
|
|
14
|
+
.filter((macro) => macro.startLineNumbers.length > 0)
|
|
15
|
+
.map((macro) => {
|
|
16
|
+
var _a;
|
|
17
|
+
return ({
|
|
18
|
+
firstLine: macro.startLineNumbers[0],
|
|
19
|
+
// A definition with no `%mend` keeps reading to the end of the file, so
|
|
20
|
+
// nothing after its declaration is open code - SAS reads it as the macro
|
|
21
|
+
// body, and reporting it as open code would point at a fix that is not
|
|
22
|
+
// the one the file needs.
|
|
23
|
+
lastLine: (_a = macro.endLineNumber) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
const isInMacro = (spans, lineNumber) => spans.some((span) => lineNumber >= span.firstLine && lineNumber <= span.lastLine);
|
|
27
|
+
/**
|
|
28
|
+
* Reports each `%if` that runs in open code - that is, outside every `%macro`
|
|
29
|
+
* definition in the file.
|
|
30
|
+
*
|
|
31
|
+
* `%if-%then-%else` in open code is a SAS 9.4M5 feature. On an earlier
|
|
32
|
+
* maintenance the statement is rejected outright - "ERROR: The %IF statement is
|
|
33
|
+
* not valid in open code" - so a file that uses one cannot run on a session
|
|
34
|
+
* before M5, and one that wraps the same logic in a macro can.
|
|
35
|
+
*
|
|
36
|
+
* The scan comes from `parseMacroCalls`, so a `%if` inside a block comment, a
|
|
37
|
+
* macro comment, a comment statement, a data section, an embedded-language
|
|
38
|
+
* `submit` block or a `%str` / `%nrstr` argument is not reported, and neither is
|
|
39
|
+
* one inside a single-quoted string, where SAS resolves no macro trigger. A
|
|
40
|
+
* double-quoted string is scanned as code, because SAS resolves triggers there -
|
|
41
|
+
* a `%if` template written in one is still a statement the target session has to
|
|
42
|
+
* accept.
|
|
43
|
+
*
|
|
44
|
+
* The rule is off by default: it encodes a release floor, so it applies to the
|
|
45
|
+
* projects whose floor is earlier than 9.4M5 and is noise everywhere else.
|
|
46
|
+
*
|
|
47
|
+
* There is no fix. Moving a block into a macro means writing a `%macro` /
|
|
48
|
+
* `%mend` pair and an invocation around code the formatter cannot reorder, and
|
|
49
|
+
* a rewrite that guesses the macro name is worse than the warning.
|
|
50
|
+
*/
|
|
51
|
+
const test = (value, config) => {
|
|
52
|
+
if (!value)
|
|
53
|
+
return [];
|
|
54
|
+
const cfg = config || new types_1.LintConfig();
|
|
55
|
+
const severity = cfg.severityLevel[name] || Severity_1.Severity.Warning;
|
|
56
|
+
const spans = getMacroSpans(value, cfg);
|
|
57
|
+
return (0, parseMacroCalls_1.parseMacroCalls)(value, cfg)
|
|
58
|
+
.filter((call) => call.name.toLowerCase() === 'if' && !call.quoted)
|
|
59
|
+
.filter((call) => !isInMacro(spans, call.lineNumber))
|
|
60
|
+
.map((call) => ({
|
|
61
|
+
message,
|
|
62
|
+
lineNumber: call.lineNumber,
|
|
63
|
+
startColumnNumber: call.startColumnNumber,
|
|
64
|
+
endColumnNumber: call.endColumnNumber,
|
|
65
|
+
severity
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Lint rule that reports `%if` used in open code.
|
|
70
|
+
*
|
|
71
|
+
* Enable it with `"noMacroIfInOpenCode": true` where the SAS floor is earlier
|
|
72
|
+
* than 9.4 Maintenance 5, which is the release that added `%if-%then-%else` in
|
|
73
|
+
* open code. At M5 the `%then` / `%else` clause must be a `%do` / `%end` block,
|
|
74
|
+
* so the construct this rule removes is the `%if ... %then %do; ... %end;`
|
|
75
|
+
* block that cannot run below that floor.
|
|
76
|
+
*/
|
|
77
|
+
exports.noMacroIfInOpenCode = {
|
|
78
|
+
type: LintRuleType_1.LintRuleType.File,
|
|
79
|
+
name,
|
|
80
|
+
description,
|
|
81
|
+
message,
|
|
82
|
+
test
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=noMacroIfInOpenCode.js.map
|
|
@@ -0,0 +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,OAAO,GAAG,2GAA2G,CAAA;AAW3H,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,MAAmB,EAAe,EAAE,CACxE,IAAA,yBAAW,EAAC,KAAK,EAAE,MAAM,CAAC;IACxB,yEAAyE;KACxE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;KACpD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;;IAAC,OAAA,CAAC;QACf,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACpC,wEAAwE;QACxE,yEAAyE;QACzE,uEAAuE;QACvE,0BAA0B;QAC1B,QAAQ,EAAE,MAAA,KAAK,CAAC,aAAa,mCAAI,MAAM,CAAC,iBAAiB;KAC1D,CAAC,CAAA;CAAA,CAAC,CAAA;AAEP,MAAM,SAAS,GAAG,CAAC,KAAkB,EAAE,UAAkB,EAAW,EAAE,CACpE,KAAK,CAAC,IAAI,CACR,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,IAAI,UAAU,IAAI,IAAI,CAAC,QAAQ,CACtE,CAAA;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,MAAmB,EAAgB,EAAE;IAChE,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,GAAG,GAAG,MAAM,IAAI,IAAI,kBAAU,EAAE,CAAA;IACtC,MAAM,QAAQ,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,mBAAQ,CAAC,OAAO,CAAA;IAC5D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAEvC,OAAO,IAAA,iCAAe,EAAC,KAAK,EAAE,GAAG,CAAC;SAC/B,MAAM,CAAC,CAAC,IAAI,EAAE,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"}
|
|
@@ -34,6 +34,13 @@ const getUndeclaredCalls = (value, config) => {
|
|
|
34
34
|
if (macro.name)
|
|
35
35
|
declared.add(macro.name.toLowerCase());
|
|
36
36
|
});
|
|
37
|
+
// A macro the file emits is defined here even though `parseMacros` cannot see
|
|
38
|
+
// it: the definition sits inside a string, which the parser reads as part of a
|
|
39
|
+
// statement. Reporting it would have the fix add a dependency the file does
|
|
40
|
+
// not have.
|
|
41
|
+
getTemplateDefinitions(value).forEach((macro) => {
|
|
42
|
+
declared.add(macro.toLowerCase());
|
|
43
|
+
});
|
|
37
44
|
(0, headerMacros_1.getHeaderMacros)(value, config).forEach((macro) => {
|
|
38
45
|
declared.add(macro.name.toLowerCase());
|
|
39
46
|
});
|
|
@@ -68,6 +75,34 @@ const getUndeclaredCalls = (value, config) => {
|
|
|
68
75
|
});
|
|
69
76
|
return undeclared;
|
|
70
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Names the file defines, counting a definition written into a template string.
|
|
80
|
+
* A macro that emits a program writes it with `put '...'` lines, so the macro
|
|
81
|
+
* its program calls is defined in the same file, in a string that `parseMacros`
|
|
82
|
+
* cannot read as a definition.
|
|
83
|
+
*
|
|
84
|
+
* The pattern is anchor matching, not quote tracking. A definition starts a line
|
|
85
|
+
* or follows a `;` or the quote that opens a string, and the name is followed by
|
|
86
|
+
* whatever a macro header continues with: `(`, `;`, or `/` for macro options
|
|
87
|
+
* (`%macro mf_foo / parmbuff;`). `hasMacroParentheses` asks for the parenthesis
|
|
88
|
+
* form from code this repo writes; text a file emits is not held to it here,
|
|
89
|
+
* because a definition it cannot parse would otherwise re-open the false report
|
|
90
|
+
* this function exists to close.
|
|
91
|
+
*
|
|
92
|
+
* Quote state would be the obvious way to tell code from text, and it is
|
|
93
|
+
* unusable here: straight matching desynchronises on an apostrophe in a comment,
|
|
94
|
+
* and files in `sasjs/core` carry an odd number of quotes.
|
|
95
|
+
*
|
|
96
|
+
* Four consequences of matching text rather than syntax, all of which err toward
|
|
97
|
+
* silence: a definition commented out on its own line counts as one, a
|
|
98
|
+
* definition inside `%str`-masked text counts as one, a quoted example in a doc
|
|
99
|
+
* comment counts as one, and so does a definition emitted without a parameter
|
|
100
|
+
* list. A missed report is recoverable - the macro is declared anyway - whereas a
|
|
101
|
+
* false report has the fix add a dependency that does not exist.
|
|
102
|
+
*/
|
|
103
|
+
const getTemplateDefinitions = (value) => [
|
|
104
|
+
...value.matchAll(/(?:^|['";\n])[ \t]*%macro\s+([a-z_][a-z0-9_]*)\s*[;(/]/gi)
|
|
105
|
+
].map((match) => match[1]);
|
|
71
106
|
const test = (value, config) => {
|
|
72
107
|
const cfg = config || new types_1.LintConfig();
|
|
73
108
|
const severity = cfg.severityLevel[name] || Severity_1.Severity.Warning;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noUndeclaredMacros.js","sourceRoot":"","sources":["../../../src/rules/file/noUndeclaredMacros.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,2DAA6E;AAC7E,iEAAwE;AACxE,yDAAqD;AACrD,qDAAkD;AAElD,MAAM,IAAI,GAAG,oBAAoB,CAAA;AACjC,MAAM,WAAW,GAAG,sDAAsD,CAAA;AAC1E,MAAM,OAAO,GAAG,mIAAmI,CAAA;AAEnJ;;;;;;;;;;;;;;GAcG;AACH,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,MAAkB,EAAe,EAAE;IAC5E,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;IAElC,IAAA,yBAAW,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3C,IAAI,KAAK,CAAC,IAAI;YAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;IAEF,IAAA,8BAAe,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/C,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IACxC,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IA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,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC;QAC9C,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,QAAQ;KACT,CAAC,CAAC,CAAA;AACL,CAAC,CAAA;AAED,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,MAAmB,EAAU,EAAE;IACzD,MAAM,GAAG,GAAG,MAAM,IAAI,IAAI,kBAAU,EAAE,CAAA;IACtC,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEtE,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,KAAK,CAAA;IAEhC,OAAO,IAAA,gCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;AAC9C,CAAC,CAAA;AAED;;;;GAIG;AACU,QAAA,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
package/sasjslint-schema.json
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"noBannedStrings": true,
|
|
26
26
|
"noEncodedPasswords": true,
|
|
27
27
|
"noGremlins": true,
|
|
28
|
+
"noMacroIfInOpenCode": false,
|
|
28
29
|
"noNestedCommentsInHeader": true,
|
|
29
30
|
"noNestedMacros": true,
|
|
30
31
|
"noSingleAsteriskComments": false,
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"maxHeaderLineLength": 80,
|
|
51
52
|
"maxDataLineLength": 80,
|
|
52
53
|
"noGremlins": true,
|
|
54
|
+
"noMacroIfInOpenCode": false,
|
|
53
55
|
"allowedGremlins": ["0x0080", "0x3000"],
|
|
54
56
|
"noTabs": true,
|
|
55
57
|
"indentationMultiple": 4,
|
|
@@ -109,6 +111,14 @@
|
|
|
109
111
|
"default": [true],
|
|
110
112
|
"examples": [true, false]
|
|
111
113
|
},
|
|
114
|
+
"noMacroIfInOpenCode": {
|
|
115
|
+
"$id": "#/properties/noMacroIfInOpenCode",
|
|
116
|
+
"type": "boolean",
|
|
117
|
+
"title": "noMacroIfInOpenCode",
|
|
118
|
+
"description": "Reports %if used in open code - that is, outside every %macro definition in the file. Open-code %if-%then-%else is a SAS 9.4M5 feature, so a program that uses one cannot run on an earlier maintenance; at M5 the %then / %else clause has to be a %do / %end block. Off by default, because the rule encodes a release floor - enable it where the floor is earlier than 9.4M5. There is no fix; move the block inside a %macro definition.",
|
|
119
|
+
"default": false,
|
|
120
|
+
"examples": [true, false]
|
|
121
|
+
},
|
|
112
122
|
"bannedStrings": {
|
|
113
123
|
"$id": "#/properties/bannedStrings",
|
|
114
124
|
"type": "array",
|
|
@@ -499,6 +509,13 @@
|
|
|
499
509
|
"enum": ["error", "warn"],
|
|
500
510
|
"default": "warn"
|
|
501
511
|
},
|
|
512
|
+
"noMacroIfInOpenCode": {
|
|
513
|
+
"$id": "#/properties/severityLevel/noMacroIfInOpenCode",
|
|
514
|
+
"title": "noMacroIfInOpenCode",
|
|
515
|
+
"type": "string",
|
|
516
|
+
"enum": ["error", "warn"],
|
|
517
|
+
"default": "warn"
|
|
518
|
+
},
|
|
502
519
|
"hasRequiredMacroOptions": {
|
|
503
520
|
"$id": "#/properties/severityLevel/hasRequiredMacroOptions",
|
|
504
521
|
"title": "hasRequiredMacroOptions",
|
package/types/LintConfig.js
CHANGED
|
@@ -145,6 +145,12 @@ class LintConfig {
|
|
|
145
145
|
if ((json === null || json === void 0 ? void 0 : json.noNestedMacros) !== false) {
|
|
146
146
|
this.fileLintRules.push(file_1.noNestedMacros);
|
|
147
147
|
}
|
|
148
|
+
// Off by default: the rule encodes a SAS release floor - open-code %if
|
|
149
|
+
// needs 9.4M5 - so it is enabled by the projects whose floor is earlier
|
|
150
|
+
// and is noise for everyone else.
|
|
151
|
+
if (json === null || json === void 0 ? void 0 : json.noMacroIfInOpenCode) {
|
|
152
|
+
this.fileLintRules.push(file_1.noMacroIfInOpenCode);
|
|
153
|
+
}
|
|
148
154
|
// Absence means the documented default, so a project that omits the key
|
|
149
155
|
// still gets the floor. A value below two switches the rule off, the way a
|
|
150
156
|
// zero `maxLineLength` does - and the value is still kept, so the macro
|
package/types/LintConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;AAAA,wCAesB;AACtB,wCAQsB;AACtB,wCAAuE;AACvE,+CAA2C;AAE3C,oCAIiB;AACjB,8DAA0D;AAC1D,yCAAqC;AAErC;;;;;;GAMG;AACH,MAAa,UAAU;IAqBrB,YAAY,IAAU;QAlBb,eAAU,GAAa,EAAE,CAAA;QACzB,oBAAe,GAAa,EAAE,CAAA;QAC9B,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAW,EAAE,CAAA;QAC1B,wBAAmB,GAAW,EAAE,CAAA;QAChC,sBAAiB,GAAW,EAAE,CAAA;QAC9B,wBAAmB,GAAW,CAAC,CAAA;QAC/B,uBAAkB,GAAW,CAAC,CAAA;QAC9B,gBAAW,GAAgB,yBAAW,CAAC,EAAE,CAAA;QACzC,kBAAa,GAAW,IAAA,wBAAgB,GAAE,CAAA;QAC1C,kBAAa,GAAgC,EAAE,CAAA;QAC/C,y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GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAA;QAChD,CAAC;QAED,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,CAAC,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAA;QAChD,CAAC;QAED,OAAO,IAAI,UAAU,CAAC,IAAA,iCAAe,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IACtD,CAAC;CACF;AAzTD,gCAyTC"}
|
package/utils/getLintConfig.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const DefaultLintConfiguration: {
|
|
|
30
30
|
noBannedStrings: boolean;
|
|
31
31
|
noEncodedPasswords: boolean;
|
|
32
32
|
noGremlins: boolean;
|
|
33
|
+
noMacroIfInOpenCode: boolean;
|
|
33
34
|
noNestedCommentsInHeader: boolean;
|
|
34
35
|
noNestedMacros: boolean;
|
|
35
36
|
noSingleAsteriskComments: boolean;
|
package/utils/getLintConfig.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLintConfig.js","sourceRoot":"","sources":["../../src/utils/getLintConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getLintConfig.js","sourceRoot":"","sources":["../../src/utils/getLintConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA6DA,sCASC;AAtED,gDAAuB;AACvB,4CAAmB;AACnB,oDAAgD;AAChD,4CAA4C;AAC5C,qDAAiD;AACjD,sDAAkD;AAClD,iEAA6D;AAC7D,iEAA6D;AAEtD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,wIAAwI,CAAA;AAD7H,QAAA,gBAAgB,oBAC6G;AAE1I;;;;;;;GAOG;AACU,QAAA,wBAAwB,GAAG;IACtC,eAAe,EAAE,EAAE;IACnB,aAAa,EAAE,CAAC,GAAG,2CAAoB,CAAC;IACxC,aAAa,EAAE,IAAA,wBAAgB,GAAE;IACj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