@sasjs/lint 2.5.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.
- package/.git-hooks/pre-commit +18 -0
- package/.github/CONTRIBUTING.md +27 -0
- package/.github/workflows/build.yml +13 -3
- package/.github/workflows/publish.yml +12 -1
- package/.pre-commit-config.yaml +16 -0
- package/README.md +19 -0
- package/lint/lintText.d.ts +6 -2
- package/lint/lintText.js +7 -4
- package/lint/lintText.js.map +1 -1
- package/package.json +9 -10
- 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/noSingleAsteriskComments.d.ts +7 -0
- package/rules/file/noSingleAsteriskComments.js +219 -0
- package/rules/file/noSingleAsteriskComments.js.map +1 -0
- package/sasjslint-schema.json +17 -0
- package/types/LintConfig.js +3 -0
- package/types/LintConfig.js.map +1 -1
|
@@ -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
|
package/.github/CONTRIBUTING.md
CHANGED
|
@@ -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,14 +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
|
-
|
|
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
|
|
29
41
|
- name: Check Code Style
|
|
30
42
|
run: npm run lint
|
|
31
43
|
- name: Run Unit Tests
|
|
32
44
|
run: npm test
|
|
33
|
-
- name: Install rimraf
|
|
34
|
-
run: npm i -g rimraf
|
|
35
45
|
- name: Build Package
|
|
36
46
|
run: npm run package:lib
|
|
37
47
|
env:
|
|
@@ -64,7 +64,18 @@ jobs:
|
|
|
64
64
|
run: npm run publishInit
|
|
65
65
|
|
|
66
66
|
- name: Semantic Release
|
|
67
|
-
|
|
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/lint/lintText.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { Diagnostic, LintConfig } from '../types';
|
|
1
2
|
/**
|
|
2
3
|
* Analyses and produces a set of diagnostics for the given text content.
|
|
3
4
|
* @param {string} text - the text content to be linted.
|
|
4
|
-
* @
|
|
5
|
+
* @param {LintConfig} configuration - an optional lint configuration. The
|
|
6
|
+
* nearest `.sasjslint` file provides the configuration when it is omitted.
|
|
7
|
+
* @returns {Diagnostic[]} array of diagnostic objects, each containing a
|
|
8
|
+
* warning, line number and column number.
|
|
5
9
|
*/
|
|
6
|
-
export declare const lintText: (text: string) => Promise<
|
|
10
|
+
export declare const lintText: (text: string, configuration?: LintConfig) => Promise<Diagnostic[]>;
|
package/lint/lintText.js
CHANGED
|
@@ -10,15 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.lintText = void 0;
|
|
13
|
-
const
|
|
13
|
+
const utils_1 = require("../utils");
|
|
14
14
|
const shared_1 = require("./shared");
|
|
15
15
|
/**
|
|
16
16
|
* Analyses and produces a set of diagnostics for the given text content.
|
|
17
17
|
* @param {string} text - the text content to be linted.
|
|
18
|
-
* @
|
|
18
|
+
* @param {LintConfig} configuration - an optional lint configuration. The
|
|
19
|
+
* nearest `.sasjslint` file provides the configuration when it is omitted.
|
|
20
|
+
* @returns {Diagnostic[]} array of diagnostic objects, each containing a
|
|
21
|
+
* warning, line number and column number.
|
|
19
22
|
*/
|
|
20
|
-
const lintText = (text) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
const config = yield (0,
|
|
23
|
+
const lintText = (text, configuration) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
const config = configuration || (yield (0, utils_1.getLintConfig)());
|
|
22
25
|
return (0, shared_1.processText)(text, config);
|
|
23
26
|
});
|
|
24
27
|
exports.lintText = lintText;
|
package/lint/lintText.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lintText.js","sourceRoot":"","sources":["../../src/lint/lintText.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"lintText.js","sourceRoot":"","sources":["../../src/lint/lintText.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oCAAwC;AACxC,qCAAsC;AAEtC;;;;;;;GAOG;AACI,MAAM,QAAQ,GAAG,CACtB,IAAY,EACZ,aAA0B,EACH,EAAE;IACzB,MAAM,MAAM,GAAG,aAAa,IAAI,CAAC,MAAM,IAAA,qBAAa,GAAE,CAAC,CAAA;IACvD,OAAO,IAAA,oBAAW,EAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAClC,CAAC,CAAA,CAAA;AANY,QAAA,QAAQ,YAMpB"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Linting and formatting for SAS code",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"test": "jest --coverage",
|
|
6
|
-
"build": "
|
|
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",
|
|
@@ -58,18 +58,17 @@
|
|
|
58
58
|
},
|
|
59
59
|
"homepage": "https://github.com/sasjs/lint#readme",
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@semantic-release/git": "10.0.1",
|
|
61
|
+
"@nogoo9/gitleaks": "8.30.1-post.2",
|
|
63
62
|
"@types/jest": "30.0.0",
|
|
64
|
-
"@types/node": "26.
|
|
65
|
-
"jest": "30.5.
|
|
66
|
-
"
|
|
67
|
-
"ts-jest": "29.4.
|
|
68
|
-
"typescript": "
|
|
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"
|
|
69
68
|
},
|
|
70
69
|
"dependencies": {
|
|
71
70
|
"@sasjs/utils": "3.6.2",
|
|
72
|
-
"ignore": "7.0.
|
|
71
|
+
"ignore": "7.0.11"
|
|
73
72
|
},
|
|
74
|
-
"version": "2.
|
|
73
|
+
"version": "2.7.0"
|
|
75
74
|
}
|
package/rules/file/index.d.ts
CHANGED
|
@@ -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';
|
package/rules/file/index.js
CHANGED
|
@@ -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
|
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,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,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,IAAI,CAAC,KAAI,mBAAQ,CAAC,OAAO,CAAA;IAChE,MAAM,WAA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wBAAwB,GAAiB;IACpD,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;CACL,CAAA"}
|
package/sasjslint-schema.json
CHANGED
|
@@ -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",
|
package/types/LintConfig.js
CHANGED
|
@@ -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) {
|
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,wCASsB;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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