@sasjs/lint 2.6.0 → 2.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.
@@ -0,0 +1,18 @@
1
+ #!/bin/bash
2
+
3
+ # Scan staged changes for secrets before anything else runs.
4
+ # The binary is pinned by the @nogoo9/gitleaks devDependency and lands in
5
+ # node_modules/.bin after `npm i` in the repo root. Commits are blocked until
6
+ # it is installed so no clone silently skips the secrets scan.
7
+ gitleaks_bin=node_modules/.bin/gitleaks
8
+
9
+ if [ ! -x "$gitleaks_bin" ]; then
10
+ echo "gitleaks not found - run 'npm i' in the repo root to install it"
11
+ exit 1
12
+ fi
13
+
14
+ if ! "$gitleaks_bin" protect --staged --redact; then
15
+ echo "gitleaks detected a potential secret in your staged changes"
16
+ echo "Remove the secret, or add a .gitleaksignore entry if it is a false positive"
17
+ exit 1
18
+ fi
@@ -52,3 +52,30 @@ If you are using VS Code for development, you can automatically fix your code to
52
52
  ```
53
53
 
54
54
  If you are using another editor, or are unable to install the extension, you can run `npm run lint:fix` to fix the formatting after you've made your changes.
55
+
56
+ ## Git hooks
57
+
58
+ The repo ships its own git hooks in [`.git-hooks/`](../.git-hooks):
59
+
60
+ - `pre-commit` - scans staged changes for secrets with gitleaks, and requires the `@nogoo9/gitleaks` devDependency to be installed
61
+ - `commit-msg` - verifies the commit message follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) standard
62
+
63
+ The repo `.npmrc` sets `ignore-scripts=true`, so the `prepare` script that would normally set `core.hooksPath` during `npm i` never runs. After cloning (or if your commits are not being checked), activate the hooks with a one-time command, run from the repo root:
64
+
65
+ ```bash
66
+ git config core.hooksPath ./.git-hooks
67
+ ```
68
+
69
+ The pre-commit hook runs the gitleaks binary provided by the `@nogoo9/gitleaks` devDependency, so make sure `npm i` has run in the repo root before your first commit.
70
+
71
+ If you use the [pre-commit](https://pre-commit.com) framework, the repo also ships a [`.pre-commit-config.yaml`](../.pre-commit-config.yaml) that pins the upstream gitleaks hook to an exact release tag. Activate it with `pre-commit install`.
72
+
73
+ ## CI is the enforcement point
74
+
75
+ The [build workflow](./workflows/build.yml) scans the full history for secrets with gitleaks, runs `npm audit`, checks code style and runs the tests. The local hooks are convenience - CI is what a red finding must fail.
76
+
77
+ ## The release toolchain lives in the workflow
78
+
79
+ semantic-release is not a project dependency. Every `@semantic-release` plugin declares a `semantic-release` peer, so adding one to `devDependencies` makes npm auto-install semantic-release along with the `npm` package it bundles - and that bundled npm carries advisories this repo cannot fix.
80
+
81
+ Instead, [publish.yml](./workflows/publish.yml) installs semantic-release, `@semantic-release/exec` and `@semantic-release/git` on the fly, pinned to exact versions. When you add or remove an entry in `release.plugins` (package.json), update that command to match.
@@ -24,18 +24,24 @@ jobs:
24
24
  cache: npm
25
25
  - name: Install Dependencies
26
26
  run: npm ci
27
+ - name: Scan for secrets (gitleaks)
28
+ # The local pre-commit hook is suppressed entirely when .npmrc sets
29
+ # ignore-scripts=true (the prepare script that would activate the
30
+ # hooks never runs), so CI is the enforcement point: a leaked
31
+ # credential must fail the build, not just a commit.
32
+ # Uses the same @nogoo9/gitleaks binary the pre-commit hook pins - the
33
+ # gitleaks-action requires a license key for organization repos.
34
+ run: node_modules/.bin/gitleaks detect --source . --redact --no-banner -v
27
35
  - name: Security Audit
28
- # `npm audit` fails on advisories inside the `npm` package bundled by
29
- # @semantic-release/npm, which no overrides entry can reach. The audit
30
- # script names those and fails on everything else, so a new advisory
31
- # anywhere in the tree still fails the build.
32
- run: npm run audit
36
+ # The release toolchain is not a project dependency (see publish.yml),
37
+ # so the `npm` package bundled by @semantic-release/npm never reaches
38
+ # this tree - which is what made the old exemption-based audit script
39
+ # necessary. A plain audit is clean.
40
+ run: npm audit
33
41
  - name: Check Code Style
34
42
  run: npm run lint
35
43
  - name: Run Unit Tests
36
44
  run: npm test
37
- - name: Install rimraf
38
- run: npm i -g rimraf
39
45
  - name: Build Package
40
46
  run: npm run package:lib
41
47
  env:
@@ -64,7 +64,18 @@ jobs:
64
64
  run: npm run publishInit
65
65
 
66
66
  - name: Semantic Release
67
- run: npx semantic-release
67
+ # The release toolchain is deliberately not a project dependency: every
68
+ # @semantic-release plugin declares a `semantic-release` peer, which npm
69
+ # auto-installs together with the `npm` package semantic-release bundles
70
+ # - and that bundled npm carries advisories nothing here can fix.
71
+ # Installing it here, pinned, keeps the dependency tree clean. Keep
72
+ # these versions in step with `release.plugins` in package.json.
73
+ run: |
74
+ npx --yes \
75
+ --package semantic-release@25.0.9 \
76
+ --package @semantic-release/exec@7.1.0 \
77
+ --package @semantic-release/git@11.0.1 \
78
+ semantic-release
68
79
  env:
69
80
  GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} # <-- app token, not secrets.GITHUB_TOKEN
70
81
 
@@ -0,0 +1,16 @@
1
+ # Hooks for the pre-commit framework - https://pre-commit.com
2
+ #
3
+ # The repo also ships native hooks in .git-hooks/, covering the secret scan, a
4
+ # 2MB commit size limit and Conventional Commits. But .npmrc sets
5
+ # ignore-scripts=true, so the `prepare` script that would activate them never
6
+ # runs on `npm i` - a fresh clone commits unchecked until the one-time command
7
+ # in .github/CONTRIBUTING.md is run by hand.
8
+ #
9
+ # This file is the standard route instead: install the framework once with
10
+ # `pre-commit install`, and the secret scan runs on every commit. The hook is
11
+ # pinned to an exact gitleaks release tag.
12
+ repos:
13
+ - repo: https://github.com/gitleaks/gitleaks
14
+ rev: v8.30.1
15
+ hooks:
16
+ - id: gitleaks
package/README.md CHANGED
@@ -35,6 +35,7 @@ Configuration is via a `.sasjslint` file with the following structure (these are
35
35
  "maxLineLength": 80,
36
36
  "noEncodedPasswords": true,
37
37
  "noNestedMacros": true,
38
+ "noSingleAsteriskComments": false,
38
39
  "noGremlins": true,
39
40
  "noSpacesInFileNames": true,
40
41
  "noTabs": true,
@@ -237,6 +238,23 @@ Where macros are defined inside other macros, they are recompiled every time the
237
238
  - Default: true
238
239
  - Severity: WARNING
239
240
 
241
+ ### noSingleAsteriskComments
242
+
243
+ SAS supports a comment statement that begins with a single asterisk and runs to the next semicolon, for example `* some text;`. This style is easy to mistype - a missing terminating semicolon turns the rest of the program into a comment - and it cannot be nested, so the SASjs framework recommends block comments (`/* ... */`) instead.
244
+
245
+ This rule reports a warning for each comment statement that begins with a single asterisk. It ignores asterisks inside quoted strings, `%str()` / `%nrstr()` arguments, macro comments (`%* ... ;`), data sections (`datalines` / `cards`), `proc lua` / `proc groovy` submit blocks and arithmetic expressions (`a * b`, `b ** a`, `select * from`), so it only fires on genuine comment statements.
246
+
247
+ - Default: false
248
+ - Severity: WARNING
249
+
250
+ Example:
251
+
252
+ ```json
253
+ {
254
+ "noSingleAsteriskComments": true
255
+ }
256
+ ```
257
+
240
258
  ### noSpacesInFileNames
241
259
 
242
260
  The 'beef' we have with spaces in filenames is twofold:
@@ -307,6 +325,7 @@ We're looking to implement the following rules:
307
325
  - Change tabs to spaces
308
326
  - zap gremlins
309
327
  - fix line endings
328
+ - convert single asterisk comments to block comments
310
329
 
311
330
  We are also investigating some harder stuff, such as automatic indentation and code layout
312
331
 
package/package.json CHANGED
@@ -3,15 +3,14 @@
3
3
  "description": "Linting and formatting for SAS code",
4
4
  "scripts": {
5
5
  "test": "jest --coverage",
6
- "build": "npx rimraf build && tsc",
6
+ "build": "rimraf build && tsc",
7
7
  "preinstall": "node checkNodeVersion",
8
8
  "prebuild": "node checkNodeVersion",
9
9
  "publishInit": "cp -r ./build/* . && rm -rf ./build && rm -rf ./src && rm tsconfig.json",
10
10
  "package:lib": "npm run build && cp ./package.json ./checkNodeVersion.js build && cp README.md build && cd build && npm version \"5.0.0\" && npm pack",
11
11
  "lint:fix": "npx prettier --write \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"",
12
12
  "lint": "npx prettier --check \"{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"",
13
- "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true",
14
- "audit": "node scripts/audit.mjs"
13
+ "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true"
15
14
  },
16
15
  "publishConfig": {
17
16
  "access": "public"
@@ -59,18 +58,17 @@
59
58
  },
60
59
  "homepage": "https://github.com/sasjs/lint#readme",
61
60
  "devDependencies": {
62
- "@semantic-release/exec": "6.0.3",
63
- "@semantic-release/git": "10.0.1",
61
+ "@nogoo9/gitleaks": "8.30.1-post.2",
64
62
  "@types/jest": "30.0.0",
65
- "@types/node": "26.4.1",
66
- "jest": "30.5.1",
67
- "semantic-release": "25.0.8",
68
- "ts-jest": "29.4.12",
69
- "typescript": "5.9.3"
63
+ "@types/node": "26.6.3",
64
+ "jest": "30.5.2",
65
+ "rimraf": "6.1.3",
66
+ "ts-jest": "29.4.14",
67
+ "typescript": "6.0.3"
70
68
  },
71
69
  "dependencies": {
72
70
  "@sasjs/utils": "3.6.2",
73
- "ignore": "7.0.8"
71
+ "ignore": "7.0.11"
74
72
  },
75
- "version": "2.6.0"
73
+ "version": "2.7.0"
76
74
  }
@@ -5,3 +5,4 @@ export { lineEndings } from './lineEndings';
5
5
  export { noNestedMacros } from './noNestedMacros';
6
6
  export { strictMacroDefinition } from './strictMacroDefinition';
7
7
  export { hasRequiredMacroOptions } from './hasRequiredMacroOptions';
8
+ export { noSingleAsteriskComments } from './noSingleAsteriskComments';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasRequiredMacroOptions = exports.strictMacroDefinition = exports.noNestedMacros = exports.lineEndings = exports.hasMacroParentheses = exports.hasMacroNameInMend = exports.hasDoxygenHeader = void 0;
3
+ exports.noSingleAsteriskComments = exports.hasRequiredMacroOptions = exports.strictMacroDefinition = exports.noNestedMacros = 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");
@@ -15,4 +15,6 @@ var strictMacroDefinition_1 = require("./strictMacroDefinition");
15
15
  Object.defineProperty(exports, "strictMacroDefinition", { enumerable: true, get: function () { return strictMacroDefinition_1.strictMacroDefinition; } });
16
16
  var hasRequiredMacroOptions_1 = require("./hasRequiredMacroOptions");
17
17
  Object.defineProperty(exports, "hasRequiredMacroOptions", { enumerable: true, get: function () { return hasRequiredMacroOptions_1.hasRequiredMacroOptions; } });
18
+ var noSingleAsteriskComments_1 = require("./noSingleAsteriskComments");
19
+ Object.defineProperty(exports, "noSingleAsteriskComments", { enumerable: true, get: function () { return noSingleAsteriskComments_1.noSingleAsteriskComments; } });
18
20
  //# sourceMappingURL=index.js.map
@@ -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,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,qEAAmE;AAA1D,kIAAA,uBAAuB,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,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA"}
@@ -0,0 +1,7 @@
1
+ import { FileLintRule } from '../../types/LintRule';
2
+ /**
3
+ * Lint rule that checks for SAS comment statements that begin with a single
4
+ * asterisk, such as `* some text;`. These are easy to mistype and should be
5
+ * written as block comments instead.
6
+ */
7
+ export declare const noSingleAsteriskComments: FileLintRule;
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noSingleAsteriskComments = void 0;
4
+ const LintRuleType_1 = require("../../types/LintRuleType");
5
+ const Severity_1 = require("../../types/Severity");
6
+ const name = 'noSingleAsteriskComments';
7
+ const description = 'Disallow comment statements that begin with a single asterisk (*).';
8
+ const message = 'Line contains a single asterisk comment';
9
+ /**
10
+ * Matches the statements that open a data section. The `4` variants are
11
+ * terminated by `;;;;`, the others by a semicolon.
12
+ */
13
+ const dataSectionStart = /^(datalines4?|cards4?|parmcards4?)\s*;/i;
14
+ /**
15
+ * Matches the functions whose argument is data rather than code.
16
+ */
17
+ const maskingFunctionStart = /^%(nrstr|str)\s*\(/i;
18
+ /**
19
+ * Matches the procedures whose `submit` block holds another language, so SAS
20
+ * statement rules do not apply inside it.
21
+ */
22
+ const embeddedLanguageProc = /^proc\s+(lua|groovy)\b/i;
23
+ /**
24
+ * Matches the statement that closes an embedded-language block.
25
+ */
26
+ const embeddedLanguageEnd = /^endsubmit\s*;/i;
27
+ const embeddedLanguageEndSearch = /endsubmit/i;
28
+ const test = (value, config) => {
29
+ const severity = (config === null || config === void 0 ? void 0 : config.severityLevel[name]) || Severity_1.Severity.Warning;
30
+ const diagnostics = [];
31
+ const length = value.length;
32
+ let index = 0;
33
+ let lineNumber = 1;
34
+ let columnNumber = 1;
35
+ let atStatementStart = true;
36
+ let embeddedProc = false;
37
+ /**
38
+ * Advances the cursor to `target`, keeping the line and column counters in
39
+ * step. Every branch that consumes a non-code region moves through here.
40
+ */
41
+ const advanceTo = (target) => {
42
+ const limit = Math.min(target, length);
43
+ while (index < limit) {
44
+ if (value[index] === '\n') {
45
+ lineNumber++;
46
+ columnNumber = 1;
47
+ }
48
+ else {
49
+ columnNumber++;
50
+ }
51
+ index++;
52
+ }
53
+ };
54
+ while (index < length) {
55
+ const char = value[index];
56
+ if (char === '\n') {
57
+ lineNumber++;
58
+ columnNumber = 1;
59
+ index++;
60
+ continue;
61
+ }
62
+ if (char === '\r' || char === ' ' || char === '\t') {
63
+ columnNumber++;
64
+ index++;
65
+ continue;
66
+ }
67
+ if (char === ';') {
68
+ atStatementStart = true;
69
+ columnNumber++;
70
+ index++;
71
+ continue;
72
+ }
73
+ // Block comment - /* ... */
74
+ if (char === '/' && value[index + 1] === '*') {
75
+ let end = index + 2;
76
+ while (end < length && !(value[end] === '*' && value[end + 1] === '/')) {
77
+ end++;
78
+ }
79
+ advanceTo(Math.min(end + 2, length));
80
+ continue;
81
+ }
82
+ // Macro comment - %* ... ;
83
+ if (char === '%' && value[index + 1] === '*') {
84
+ let end = index + 2;
85
+ while (end < length && value[end] !== ';')
86
+ end++;
87
+ advanceTo(Math.min(end + 1, length));
88
+ continue;
89
+ }
90
+ // Masking functions - the argument is data, not code. `%(` and `%)` are
91
+ // the escapes for literal parentheses inside the argument, so they do not
92
+ // affect the nesting depth.
93
+ const maskingFunction = maskingFunctionStart.exec(value.slice(index));
94
+ if (maskingFunction) {
95
+ let depth = 0;
96
+ let end = index + maskingFunction[0].length - 1;
97
+ while (end < length) {
98
+ if (value[end] === '%' &&
99
+ (value[end + 1] === '(' || value[end + 1] === ')')) {
100
+ end += 2;
101
+ continue;
102
+ }
103
+ if (value[end] === '(')
104
+ depth++;
105
+ else if (value[end] === ')') {
106
+ depth--;
107
+ if (depth === 0) {
108
+ end++;
109
+ break;
110
+ }
111
+ }
112
+ end++;
113
+ }
114
+ advanceTo(end);
115
+ continue;
116
+ }
117
+ // Quoted string literal - '' and "" are escaped quote characters.
118
+ if (char === "'" || char === '"') {
119
+ let end = index + 1;
120
+ while (end < length) {
121
+ if (value[end] === char) {
122
+ if (value[end + 1] === char) {
123
+ end += 2;
124
+ continue;
125
+ }
126
+ end++;
127
+ break;
128
+ }
129
+ if (value[end] === '\n')
130
+ break;
131
+ end++;
132
+ }
133
+ advanceTo(end);
134
+ continue;
135
+ }
136
+ if (atStatementStart) {
137
+ // Inside a proc lua / proc groovy submit block - the code is another
138
+ // language, so SAS statement rules do not apply to it.
139
+ if (embeddedProc) {
140
+ const endSubmit = embeddedLanguageEnd.exec(value.slice(index));
141
+ if (endSubmit) {
142
+ embeddedProc = false;
143
+ advanceTo(index + endSubmit[0].length);
144
+ atStatementStart = true;
145
+ continue;
146
+ }
147
+ advanceTo(index + value.slice(index).search(embeddedLanguageEndSearch));
148
+ atStatementStart = true;
149
+ continue;
150
+ }
151
+ // proc lua / proc groovy opens an embedded-language block. Only enter
152
+ // the block when it is closed, so a stray `proc lua;` cannot swallow
153
+ // the rest of the file.
154
+ const embeddedProcStart = embeddedLanguageProc.exec(value.slice(index));
155
+ if (embeddedProcStart &&
156
+ embeddedLanguageEndSearch.test(value.slice(index))) {
157
+ embeddedProc = true;
158
+ advanceTo(index + embeddedProcStart[0].length);
159
+ atStatementStart = false;
160
+ continue;
161
+ }
162
+ // A data section - everything up to its terminating line is data, not
163
+ // code. The terminator is a line containing only the `;` or `;;;;`.
164
+ const dataSection = dataSectionStart.exec(value.slice(index));
165
+ if (dataSection) {
166
+ const terminator = /4/.test(dataSection[1]) ? ';;;;' : ';';
167
+ let lineStart = index + dataSection[0].length;
168
+ let end = length;
169
+ while (lineStart <= length) {
170
+ const lineEnd = value.indexOf('\n', lineStart);
171
+ const actualEnd = lineEnd === -1 ? length : lineEnd;
172
+ if (value.slice(lineStart, actualEnd).trim() === terminator) {
173
+ end = actualEnd;
174
+ break;
175
+ }
176
+ if (lineEnd === -1)
177
+ break;
178
+ lineStart = lineEnd + 1;
179
+ }
180
+ advanceTo(end);
181
+ atStatementStart = true;
182
+ continue;
183
+ }
184
+ // A comment statement - its body is opaque up to the terminating `;`.
185
+ if (char === '*') {
186
+ diagnostics.push({
187
+ message,
188
+ lineNumber,
189
+ startColumnNumber: columnNumber,
190
+ endColumnNumber: columnNumber + 1,
191
+ severity
192
+ });
193
+ let end = index + 1;
194
+ while (end < length && value[end] !== ';')
195
+ end++;
196
+ advanceTo(end + 1);
197
+ atStatementStart = true;
198
+ continue;
199
+ }
200
+ }
201
+ atStatementStart = false;
202
+ columnNumber++;
203
+ index++;
204
+ }
205
+ return diagnostics;
206
+ };
207
+ /**
208
+ * Lint rule that checks for SAS comment statements that begin with a single
209
+ * asterisk, such as `* some text;`. These are easy to mistype and should be
210
+ * written as block comments instead.
211
+ */
212
+ exports.noSingleAsteriskComments = {
213
+ type: LintRuleType_1.LintRuleType.File,
214
+ name,
215
+ description,
216
+ message,
217
+ test
218
+ };
219
+ //# sourceMappingURL=noSingleAsteriskComments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noSingleAsteriskComments.js","sourceRoot":"","sources":["../../../src/rules/file/noSingleAsteriskComments.ts"],"names":[],"mappings":";;;AAEA,2DAAuD;AACvD,mDAA+C;AAE/C,MAAM,IAAI,GAAG,0BAA0B,CAAA;AACvC,MAAM,WAAW,GACf,oEAAoE,CAAA;AACtE,MAAM,OAAO,GAAG,yCAAyC,CAAA;AAEzD;;;GAGG;AACH,MAAM,gBAAgB,GAAG,yCAAyC,CAAA;AAElE;;GAEG;AACH,MAAM,oBAAoB,GAAG,qBAAqB,CAAA;AAElD;;;GAGG;AACH,MAAM,oBAAoB,GAAG,yBAAyB,CAAA;AAEtD;;GAEG;AACH,MAAM,mBAAmB,GAAG,iBAAiB,CAAA;AAC7C,MAAM,yBAAyB,GAAG,YAAY,CAAA;AAE9C,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,MAAmB,EAAgB,EAAE;IAChE,MAAM,QAAQ,GAAG,CAAA,MAAM,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AA;QACd,KAAK,EAAE,CAAA;IACT,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAED;;;;GAIG;AACU,QAAA,wBAAwB,GAAiB;IACpD,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;CACL,CAAA"}
@@ -17,6 +17,7 @@
17
17
  "maxDataLineLength": 80,
18
18
  "noGremlins": true,
19
19
  "noNestedMacros": true,
20
+ "noSingleAsteriskComments": false,
20
21
  "noSpacesInFileNames": true,
21
22
  "noTabs": true,
22
23
  "noTrailingSpaces": true,
@@ -42,6 +43,7 @@
42
43
  "indentationMultiple": 4,
43
44
  "hasMacroNameInMend": true,
44
45
  "noNestedMacros": true,
46
+ "noSingleAsteriskComments": false,
45
47
  "hasMacroParentheses": true,
46
48
  "lineEndings": "crlf",
47
49
  "strictMacroDefinition": true,
@@ -159,6 +161,14 @@
159
161
  "default": true,
160
162
  "examples": [true, false]
161
163
  },
164
+ "noSingleAsteriskComments": {
165
+ "$id": "#/properties/noSingleAsteriskComments",
166
+ "type": "boolean",
167
+ "title": "noSingleAsteriskComments",
168
+ "description": "Enforces the absence of SAS comment statements that begin with a single asterisk, such as `* some text;`. Shows a warning for each such comment. Defaults to off.",
169
+ "default": false,
170
+ "examples": [true, false]
171
+ },
162
172
  "noSpacesInFileNames": {
163
173
  "$id": "#/properties/noSpacesInFileNames",
164
174
  "type": "boolean",
@@ -306,6 +316,13 @@
306
316
  "enum": ["error", "warn"],
307
317
  "default": "warn"
308
318
  },
319
+ "noSingleAsteriskComments": {
320
+ "$id": "#/properties/severityLevel/noSingleAsteriskComments",
321
+ "title": "noSingleAsteriskComments",
322
+ "type": "string",
323
+ "enum": ["error", "warn"],
324
+ "default": "warn"
325
+ },
309
326
  "noSpacesInFileNames": {
310
327
  "$id": "#/properties/severityLevel/noSpacesInFileNames",
311
328
  "title": "noSpacesInFileNames",
@@ -117,6 +117,9 @@ class LintConfig {
117
117
  }
118
118
  }
119
119
  }
120
+ if (json === null || json === void 0 ? void 0 : json.noSingleAsteriskComments) {
121
+ this.fileLintRules.push(file_1.noSingleAsteriskComments);
122
+ }
120
123
  if ((json === null || json === void 0 ? void 0 : json.noGremlins) !== false) {
121
124
  this.lineLintRules.push(line_1.noGremlins);
122
125
  if (json === null || json === void 0 ? void 0 : json.allowedGremlins) {
@@ -1 +1 @@
1
- {"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;AAAA,wCAQsB;AACtB,wCAOsB;AACtB,wCAAuE;AACvE,+CAA2C;AAE3C,oCAA2C;AAC3C,yCAAqC;AAErC;;;;;;GAMG;AACH,MAAa,UAAU;IAerB,YAAY,IAAU;QAdb,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,gBAAW,GAAgB,yBAAW,CAAC,EAAE,CAAA;QACzC,kBAAa,GAAW,IAAA,wBAAgB,GAAE,CAAA;QAC1C,kBAAa,GAAgC,EAAE,CAAA;QAC/C,yBAAoB,GAAa,EAAE,CAAA;QAG1C,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,EAAE,CAAC;YACrB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACnC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE;oBACpC,IAAI,OAAO,IAAI,KAAK,QAAQ;wBAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;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QAED,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,EAAE,CAAC;YACxB,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;gBAClE,IAAI,QAAQ,KAAK,MAAM;oBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,mBAAQ,CAAC,OAAO,CAAA;gBACpE,IAAI,QAAQ,KAAK,OAAO;oBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,mBAAQ,CAAC,KAAK,CAAA;YACrE,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAnKD,gCAmKC"}
package/scripts/audit.mjs DELETED
@@ -1,131 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * A strict dependency audit.
4
- *
5
- * `npm audit` fails on ANY advisory, which cannot pass in this repo: the
6
- * advisories below sit inside the `npm` package that `@semantic-release/npm`
7
- * depends on, in its bundled tree, where no `overrides` entry can reach them.
8
- * npm 12.1.0 bundles the same versions as 11.20.0, so no upgrade clears them.
9
- * They are unreachable from this package's own code and its runtime
10
- * dependencies.
11
- *
12
- * Lowering the threshold for everything would hide a new advisory anywhere
13
- * else, so instead they are named below and every other advisory fails the
14
- * build - including one of the same severity. If one disappears upstream, this
15
- * script says so, so the exemption does not outlive its reason.
16
- *
17
- * Run with `npm run audit`.
18
- */
19
- import { execFileSync } from 'node:child_process'
20
-
21
- /**
22
- * Advisories that cannot be fixed from this repo, and why.
23
- */
24
- const EXEMPT = new Map([
25
- ['GHSA-rpw4-54j3-4h4q', 'ip-address, inside the npm package bundled by @semantic-release/npm'],
26
- ['GHSA-2vr4-cq9g-pvrc', 'ip-address, inside the npm package bundled by @semantic-release/npm'],
27
- ['GHSA-3wwx-pv8p-q78v', 'undici, inside the npm package bundled by @semantic-release/npm'],
28
- // The advisories below landed upstream after the exemptions above were
29
- // written, against the same bundled copies. npm 12.1.0 bundles identical
30
- // versions of all three packages, so an upgrade clears none of them.
31
- ['GHSA-j6r3-76f7-8jcv', 'ip-address, inside the npm package bundled by @semantic-release/npm'],
32
- ['GHSA-h3mg-xc3c-68pw', 'ip-address, inside the npm package bundled by @semantic-release/npm'],
33
- ['GHSA-r53p-7pc4-xj5r', 'undici, inside the npm package bundled by @semantic-release/npm'],
34
- ['GHSA-rfgv-xxqx-mfg5', 'undici, inside the npm package bundled by @semantic-release/npm'],
35
- [
36
- 'GHSA-q2hr-2g5m-vwhr',
37
- 'brace-expansion, inside the npm package bundled by @semantic-release/npm'
38
- ],
39
- [
40
- 'GHSA-qhr7-859c-m2p7',
41
- 'brace-expansion, inside the npm package bundled by @semantic-release/npm'
42
- ],
43
- [
44
- 'GHSA-6j4f-fj2g-mc7p',
45
- 'brace-expansion, inside the npm package bundled by @semantic-release/npm'
46
- ]
47
- ])
48
-
49
- const run = () => {
50
- try {
51
- return execFileSync('npm', ['audit', '--json'], {
52
- encoding: 'utf8',
53
- stdio: ['ignore', 'pipe', 'ignore']
54
- })
55
- } catch (error) {
56
- // npm audit exits non-zero when it finds anything, which is the case we are
57
- // here to read, so the report on stdout is the payload either way.
58
- if (error.stdout) return error.stdout
59
- throw error
60
- }
61
- }
62
-
63
- let report
64
- try {
65
- report = JSON.parse(run())
66
- } catch {
67
- console.error('could not read the npm audit report')
68
- process.exit(1)
69
- }
70
-
71
- const ghsaOf = (via) => {
72
- if (typeof via === 'string') return undefined
73
- const match = /GHSA-[a-z0-9-]+/i.exec(via?.url ?? '')
74
- return match ? match[0] : undefined
75
- }
76
-
77
- const found = new Map()
78
- for (const vulnerability of Object.values(report.vulnerabilities ?? {})) {
79
- for (const via of vulnerability.via ?? []) {
80
- const id = ghsaOf(via)
81
- if (!id) continue
82
- if (!found.has(id)) {
83
- found.set(id, {
84
- id,
85
- title: via.title ?? '',
86
- severity: via.severity ?? vulnerability.severity,
87
- packages: new Set()
88
- })
89
- }
90
- found.get(id).packages.add(vulnerability.name)
91
- }
92
- }
93
-
94
- const exempt = [...found.keys()].filter((id) => EXEMPT.has(id))
95
- const failing = [...found.values()].filter((entry) => !EXEMPT.has(entry.id))
96
- const stale = [...EXEMPT.keys()].filter((id) => !found.has(id))
97
-
98
- console.log(`advisories found: ${found.size}`)
99
- for (const entry of found.values()) {
100
- const mark = EXEMPT.has(entry.id) ? 'exempt' : 'FAIL '
101
- console.log(
102
- ` ${mark} ${entry.severity.padEnd(8)} ${entry.id} ${[...entry.packages].join(', ')}`
103
- )
104
- }
105
-
106
- for (const id of stale) {
107
- console.log(` GONE ${id} no longer reported - remove its exemption`)
108
- }
109
-
110
- if (failing.length === 0 && stale.length === 0) {
111
- console.log(
112
- `audit clean: ${exempt.length} exempt, ${stale.length} stale, ${failing.length} failing`
113
- )
114
- process.exit(0)
115
- }
116
-
117
- if (stale.length > 0) {
118
- console.error(
119
- `${stale.length} exemption(s) no longer match a reported advisory.`
120
- )
121
- }
122
-
123
- if (failing.length > 0) {
124
- console.error(`${failing.length} advisory(ies) are NOT exempt:`)
125
- for (const entry of failing) {
126
- console.error(` ${entry.severity} ${entry.id} ${entry.title}`)
127
- console.error(` ${[...entry.packages].join(', ')}`)
128
- }
129
- }
130
-
131
- process.exit(1)