@fabriziosalmi/slopless 1.5.0 → 1.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/dist/engine/api.js +169 -176
- package/dist/index.d.ts +17 -0
- package/dist/index.js +212 -219
- package/package.json +6 -6
- package/rules/VBC-003.yaml +3 -0
- package/rules/VBC-015.yaml +3 -0
- package/rules/VBC-019.yaml +3 -0
- package/rules/VBC-034.yaml +3 -0
- package/rules/VBC-042.yaml +31 -3
- package/rules/VBC-049.yaml +3 -0
- package/rules/VBC-056.yaml +9 -0
- package/rules/VBC-090.yaml +7 -0
- package/rules/VBC-096.yaml +3 -0
- package/rules/VBC-103.yaml +28 -10
- package/rules/VBC-150.yaml +7 -0
- package/rules/VBC-334.yaml +17 -0
- package/rules/VBC-901.yaml +3 -0
- package/rules/VBC-906.yaml +9 -0
- package/rules/VBC-907.yaml +17 -1
- package/rules/VBC-921.yaml +3 -0
- package/rules/VBC-928.yaml +8 -0
- package/rules/VBC-933.yaml +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabriziosalmi/slopless",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"verify:bundle": "node scripts/verify-bundle.js",
|
|
23
23
|
"verify:action": "bash scripts/run-action-locally.sh . 'src/**/*.ts'",
|
|
24
24
|
"release:prep": "npm run docs:gen && npm run build && npm test && npm run verify:bundle",
|
|
25
|
-
"version": "npm run build && git add dist"
|
|
25
|
+
"version": "node scripts/check-changelog.js && npm run docs:gen && npm run build && git add dist docs README.md"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"linter",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
},
|
|
43
43
|
"type": "commonjs",
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/glob": "^
|
|
45
|
+
"@types/glob": "^9.0.0",
|
|
46
46
|
"@types/js-yaml": "^4.0.9",
|
|
47
|
-
"@types/node": "^
|
|
47
|
+
"@types/node": "^26.4.0",
|
|
48
48
|
"@vitest/coverage-v8": "^4.0.18",
|
|
49
|
-
"commander": "^
|
|
49
|
+
"commander": "^15.0.0",
|
|
50
50
|
"glob": "^13.0.6",
|
|
51
51
|
"ignore": "^7.0.5",
|
|
52
|
-
"js-yaml": "^4.1
|
|
52
|
+
"js-yaml": "^5.4.1",
|
|
53
53
|
"minimatch": "^10.2.6",
|
|
54
54
|
"ts-node": "^10.9.2",
|
|
55
55
|
"tsup": "^8.5.1",
|
package/rules/VBC-003.yaml
CHANGED
package/rules/VBC-015.yaml
CHANGED
package/rules/VBC-019.yaml
CHANGED
package/rules/VBC-034.yaml
CHANGED
package/rules/VBC-042.yaml
CHANGED
|
@@ -9,6 +9,7 @@ match:
|
|
|
9
9
|
flags: m
|
|
10
10
|
multiline: true
|
|
11
11
|
scan: all
|
|
12
|
+
exclude_doc_comments: true
|
|
12
13
|
file_types:
|
|
13
14
|
- js
|
|
14
15
|
- ts
|
|
@@ -17,10 +18,37 @@ message: >-
|
|
|
17
18
|
Too many consecutive comment lines at line {line}. Code should be self-documenting.
|
|
18
19
|
tests:
|
|
19
20
|
fire:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
# Below the first line of code, so it is commentary rather than a header.
|
|
22
|
+
- |
|
|
23
|
+
const answer = 42;
|
|
24
|
+
// filler comment line
|
|
25
|
+
// filler comment line
|
|
26
|
+
// filler comment line
|
|
27
|
+
// filler comment line
|
|
28
|
+
// filler comment line
|
|
29
|
+
// filler comment line
|
|
30
|
+
// filler comment line
|
|
31
|
+
// filler comment line
|
|
32
|
+
// filler comment line
|
|
33
|
+
// filler comment line
|
|
34
|
+
// filler comment line
|
|
35
|
+
// filler comment line
|
|
23
36
|
quiet:
|
|
24
37
|
- |
|
|
25
38
|
// one explanatory comment
|
|
26
39
|
const answer = 42;
|
|
40
|
+
# A banner at the top of a file explains what the file is. Counting it as
|
|
41
|
+
# excess commentary reported 79 module headers in one project.
|
|
42
|
+
- |
|
|
43
|
+
// ─────────────────────────────
|
|
44
|
+
// Wasm Core Bridge
|
|
45
|
+
//
|
|
46
|
+
// Lazy-loads the Rust module.
|
|
47
|
+
// All functions go through this singleton.
|
|
48
|
+
//
|
|
49
|
+
// Usage:
|
|
50
|
+
// import { core } from './bridge';
|
|
51
|
+
// const c = await core();
|
|
52
|
+
//
|
|
53
|
+
// ─────────────────────────────
|
|
54
|
+
import { core } from './bridge';
|
package/rules/VBC-049.yaml
CHANGED
package/rules/VBC-056.yaml
CHANGED
package/rules/VBC-090.yaml
CHANGED
|
@@ -18,6 +18,13 @@ match:
|
|
|
18
18
|
- c
|
|
19
19
|
- cpp
|
|
20
20
|
- md
|
|
21
|
+
- go
|
|
22
|
+
- rs
|
|
23
|
+
- java
|
|
24
|
+
- cs
|
|
25
|
+
- kt
|
|
26
|
+
- swift
|
|
27
|
+
- rb
|
|
21
28
|
message: >-
|
|
22
29
|
Passive-aggressive or helpless comment '{match}' detected at line {line}. Replace with a
|
|
23
30
|
technical explanation of the actual constraint or a link to the relevant issue tracker ticket.
|
package/rules/VBC-096.yaml
CHANGED
|
@@ -6,6 +6,9 @@ tags:
|
|
|
6
6
|
- clean-code
|
|
7
7
|
match:
|
|
8
8
|
regex: /(?:[^/\n\\]|\\.){30,}/[dgimsuvy]*
|
|
9
|
+
# Regular expression literals and nothing else. Reading strings found the
|
|
10
|
+
# slashes in a translation file; reading code found the ones in a division.
|
|
11
|
+
scan: regex
|
|
9
12
|
file_types:
|
|
10
13
|
- js
|
|
11
14
|
- ts
|
package/rules/VBC-103.yaml
CHANGED
|
@@ -10,26 +10,44 @@ match:
|
|
|
10
10
|
(?:^[ \t]*(?:#|//)(?=[^\nA-Za-z0-9]*$)[^\n]*[-=*#_|/\\+~^]{6,}[^\n]*$\n){3,}
|
|
11
11
|
flags: m
|
|
12
12
|
multiline: true
|
|
13
|
+
scan: comments
|
|
13
14
|
file_types:
|
|
14
15
|
- js
|
|
15
16
|
- ts
|
|
16
17
|
- py
|
|
17
18
|
- sh
|
|
19
|
+
- go
|
|
20
|
+
- rs
|
|
21
|
+
- java
|
|
22
|
+
- c
|
|
23
|
+
- cpp
|
|
24
|
+
- cs
|
|
25
|
+
- kt
|
|
26
|
+
- swift
|
|
27
|
+
- rb
|
|
18
28
|
message: >-
|
|
19
29
|
Block of decoration at line {line}: three or more comment lines that are shape and nothing
|
|
20
30
|
else. A rule around a section heading is punctuation and is not reported; a banner is furniture
|
|
21
31
|
that has to be maintained.
|
|
22
32
|
tests:
|
|
23
33
|
fire:
|
|
34
|
+
# A `#` banner needs a file where `#` opens a comment.
|
|
35
|
+
- file: a.py
|
|
36
|
+
code: |
|
|
37
|
+
# ####################
|
|
38
|
+
# ####################
|
|
39
|
+
# ####################
|
|
24
40
|
- |
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
// ####################
|
|
42
|
+
// ####################
|
|
43
|
+
// ####################
|
|
28
44
|
quiet:
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
- file: a.py
|
|
46
|
+
code: |
|
|
47
|
+
# --------------------------------
|
|
48
|
+
# Shared fixtures from public data
|
|
49
|
+
# --------------------------------
|
|
50
|
+
- file: a.py
|
|
51
|
+
code: |
|
|
52
|
+
# ------------------------------
|
|
53
|
+
- { file: a.py, code: '# - handles retries' }
|
package/rules/VBC-150.yaml
CHANGED
package/rules/VBC-334.yaml
CHANGED
|
@@ -10,9 +10,26 @@ match:
|
|
|
10
10
|
(As an AI language model|It's important to remember that|In conclusion,|Let's dive into|the
|
|
11
11
|
landscape of|tapestry of|delve into|unleash|unlocking|delving into|testament to)
|
|
12
12
|
flags: i
|
|
13
|
+
scan: comments
|
|
13
14
|
file_types:
|
|
14
15
|
- md
|
|
15
16
|
- txt
|
|
17
|
+
- go
|
|
18
|
+
- rs
|
|
19
|
+
- java
|
|
20
|
+
- c
|
|
21
|
+
- cpp
|
|
22
|
+
- cs
|
|
23
|
+
- kt
|
|
24
|
+
- swift
|
|
25
|
+
- rb
|
|
26
|
+
- html
|
|
27
|
+
- js
|
|
28
|
+
- ts
|
|
29
|
+
- tsx
|
|
30
|
+
- jsx
|
|
31
|
+
- py
|
|
32
|
+
- sh
|
|
16
33
|
message: >-
|
|
17
34
|
Potential AI-generated fluff or overused cliché '{match}' detected at line {line}. Keep
|
|
18
35
|
documentation concise and human-centric.
|
package/rules/VBC-901.yaml
CHANGED
package/rules/VBC-906.yaml
CHANGED
package/rules/VBC-907.yaml
CHANGED
|
@@ -5,20 +5,36 @@ category: clean-code
|
|
|
5
5
|
tags:
|
|
6
6
|
- clean-code
|
|
7
7
|
match:
|
|
8
|
+
# The marker has to open the comment. Matching it mid-sentence read prose
|
|
9
|
+
# about TODOs as a TODO: `// a TODO. Sites that DO build a header ...`
|
|
8
10
|
regex: >-
|
|
9
|
-
\
|
|
11
|
+
^[^\n\w]*(?:TODO|FIXME|HACK|XXX)\b(?!\s*[\(\[][^)\]\n]+[\)\]])(?!\s*:?\s*(?:#\d+|[A-Z][A-Z0-9]+-\d+))
|
|
12
|
+
flags: m
|
|
10
13
|
scan: comments
|
|
11
14
|
file_types:
|
|
12
15
|
- js
|
|
13
16
|
- ts
|
|
14
17
|
- py
|
|
15
18
|
- sh
|
|
19
|
+
- go
|
|
20
|
+
- rs
|
|
21
|
+
- java
|
|
22
|
+
- c
|
|
23
|
+
- cpp
|
|
24
|
+
- cs
|
|
25
|
+
- kt
|
|
26
|
+
- swift
|
|
27
|
+
- rb
|
|
16
28
|
message: >-
|
|
17
29
|
Unattributed debt marker at line {line}. Nobody owns it, so nobody will fix it. Use TODO(owner):
|
|
18
30
|
or reference an issue such as TODO: #123.
|
|
19
31
|
tests:
|
|
20
32
|
fire:
|
|
21
33
|
- '// TODO: wire up retries'
|
|
34
|
+
- '// TODO: drain the queue before closing'
|
|
22
35
|
quiet:
|
|
36
|
+
# Prose about a TODO is not a TODO.
|
|
37
|
+
- '// a TODO. Sites that build a header from dynamic data need one'
|
|
38
|
+
- '/// Reviewer note: `?` used to be a TODO no-op'
|
|
23
39
|
- '// TODO(fab): wire up retries'
|
|
24
40
|
- '// TODO: #123 wire up retries'
|
package/rules/VBC-921.yaml
CHANGED
package/rules/VBC-928.yaml
CHANGED
package/rules/VBC-933.yaml
CHANGED
|
@@ -8,9 +8,19 @@ tags:
|
|
|
8
8
|
match:
|
|
9
9
|
regex: (coming soon|under construction|not yet written|🚧\s*wip|todo:\s*write)
|
|
10
10
|
flags: i
|
|
11
|
+
scan: comments
|
|
11
12
|
file_types:
|
|
12
13
|
- md
|
|
13
14
|
- txt
|
|
15
|
+
- go
|
|
16
|
+
- rs
|
|
17
|
+
- java
|
|
18
|
+
- c
|
|
19
|
+
- cpp
|
|
20
|
+
- cs
|
|
21
|
+
- kt
|
|
22
|
+
- swift
|
|
23
|
+
- rb
|
|
14
24
|
message: >-
|
|
15
25
|
Placeholder documentation content '{match}' at line {line}. Documentation stubs with "coming
|
|
16
26
|
soon" text signal an abandoned project to new contributors. Either write the section or
|