aislop 0.10.1 → 0.10.2
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 +56 -8
- package/dist/cli.js +942 -612
- package/dist/{expo-doctor-BcIkOte5.js → expo-doctor-c-jE6pR2.js} +1 -1
- package/dist/{generic-D_T4cUaC.js → generic-BsQa13CS.js} +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +2673 -2346
- package/dist/{json-Bqkcl1DF.js → json-B01i-GOz.js} +7 -5
- package/dist/{json-OIzja7OM.js → json-CXV4D0Ib.js} +5 -3
- package/dist/mcp.js +584 -501
- package/dist/{sarif-C-vh4wcC.js → sarif-cy5SiDDq.js} +1 -1
- package/dist/{typecheck-DQSzG8fX.js → typecheck-BdQ7uFyK.js} +1 -1
- package/dist/version-BfJVwhN2.js +5 -0
- package/package.json +8 -11
- package/dist/version-rlhQD8Qh.js +0 -5
- /package/dist/{engine-info-DCvIfZ0f.js → engine-info-Cpt36DqZ.js} +0 -0
- /package/dist/{subprocess-CQUJDGgn.js → subprocess-0uXz8HdE.js} +0 -0
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
The patterns Claude Code, Cursor, Codex, and OpenCode leave behind: narrative comments above self-explanatory code, swallowed exceptions, `as any` casts, hallucinated imports, duplicated helpers, dead code, todo stubs, oversized functions. Tests pass. Lint passes. The code rots anyway.
|
|
13
13
|
|
|
14
|
-
aislop catches them.
|
|
14
|
+
aislop catches them. 50+ rules across 7 languages (TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP). Scores every change 0–100. Sub-second. Deterministic — no LLM in the runtime path, same code in, same score out. MIT-licensed, free CLI.
|
|
15
15
|
|
|
16
16
|
## Quick start
|
|
17
17
|
|
|
@@ -90,6 +90,8 @@ exclude:
|
|
|
90
90
|
|
|
91
91
|
Or via CLI: `npx aislop scan --exclude "**/*.test.ts,dist"`
|
|
92
92
|
|
|
93
|
+
**Unsupported languages**: aislop only analyses the 8 languages above. If a repo is mostly something else (C, C++, C#, Swift, Kotlin, …), scoring a handful of incidental files would misrepresent it, so aislop **withholds the score** and says so rather than printing a number off code it never read. `--json` returns `score: null`, `scoreable: false`, and a `coverage` breakdown.
|
|
94
|
+
|
|
93
95
|
**Per-rule severity**: Override the severity of any rule by id, or turn it off:
|
|
94
96
|
|
|
95
97
|
```yaml
|
|
@@ -102,6 +104,25 @@ rules:
|
|
|
102
104
|
|
|
103
105
|
`off` drops matching diagnostics; `error`/`warning` rewrites severity before scoring and reporting. Absent map keeps default behavior.
|
|
104
106
|
|
|
107
|
+
**Suppress findings inline**: Silence a specific line when you know better, with an optional reason after `--`:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
// aislop-ignore-next-line ai-slop/empty-fallback -- options is validated upstream
|
|
111
|
+
const opts = { ...defaults, ...(input || {}) };
|
|
112
|
+
|
|
113
|
+
const legacy = doThing(); // aislop-ignore-line
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`aislop-ignore-next-line` covers the line below, `aislop-ignore-line` the line it sits on, and `aislop-ignore-file` (place anywhere in the file) the whole file. Name one or more rules to scope the suppression, or omit them to silence every rule on that line. The directive works in any comment syntax (`//`, `#`, `<!-- -->`). Suppressed findings are removed before scoring, and the run reports how many were silenced.
|
|
117
|
+
|
|
118
|
+
**Ignore whole paths**: Add an `.aislopignore` at the project root (same glob semantics as `exclude`, `#` comments allowed):
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
src/generated
|
|
122
|
+
**/*.snap
|
|
123
|
+
legacy
|
|
124
|
+
```
|
|
125
|
+
|
|
105
126
|
**Extend config**: Project config can extend a parent:
|
|
106
127
|
|
|
107
128
|
```yaml
|
|
@@ -118,10 +139,13 @@ ci:
|
|
|
118
139
|
Auto-fix what's mechanical (formatters, unused imports, dead code). For issues that need context, hand off to your agent with full diagnostic info.
|
|
119
140
|
|
|
120
141
|
```bash
|
|
121
|
-
npx aislop fix #
|
|
142
|
+
npx aislop fix # auto-fixes
|
|
143
|
+
npx aislop fix --safe # only reversible fixes (imports, comment removal, formatting)
|
|
122
144
|
npx aislop fix -f # aggressive: deps, unused files
|
|
123
145
|
```
|
|
124
146
|
|
|
147
|
+
`--safe` restricts the run to fixes that cannot change behaviour — unused-import removal, import merging, narrative-comment removal, and formatting. Anything that deletes code or rewrites behaviour/attributes (console/dead-code removal, lint autofixes, unused-declaration and dependency pruning) is skipped, so a `--safe` run is genuinely "apply and commit".
|
|
148
|
+
|
|
125
149
|
### Hand off to agent
|
|
126
150
|
|
|
127
151
|
When auto-fix can't solve it, pass the remaining issues to your coding agent with full context:
|
|
@@ -219,7 +243,7 @@ Or wire it into the [pre-commit](https://pre-commit.com) framework via the bundl
|
|
|
219
243
|
# .pre-commit-config.yaml
|
|
220
244
|
repos:
|
|
221
245
|
- repo: https://github.com/scanaislop/aislop
|
|
222
|
-
rev: v0.
|
|
246
|
+
rev: v0.10.2
|
|
223
247
|
hooks:
|
|
224
248
|
- id: aislop
|
|
225
249
|
```
|
|
@@ -228,19 +252,43 @@ repos:
|
|
|
228
252
|
|
|
229
253
|
Run `npx aislop init` and accept the workflow prompt, or add manually:
|
|
230
254
|
|
|
255
|
+
```yaml
|
|
256
|
+
name: aislop
|
|
257
|
+
|
|
258
|
+
on:
|
|
259
|
+
pull_request:
|
|
260
|
+
push:
|
|
261
|
+
branches: [main]
|
|
262
|
+
|
|
263
|
+
jobs:
|
|
264
|
+
quality-gate:
|
|
265
|
+
runs-on: ubuntu-latest
|
|
266
|
+
steps:
|
|
267
|
+
- uses: actions/checkout@v4
|
|
268
|
+
|
|
269
|
+
- uses: scanaislop/aislop@v0.10.2
|
|
270
|
+
with:
|
|
271
|
+
version: latest
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
`uses: scanaislop/aislop@v0.10.2` pins the GitHub Action wrapper. `version: latest` follows the latest npm CLI. For fully deterministic CI, set both to the same release:
|
|
275
|
+
|
|
231
276
|
```yaml
|
|
232
277
|
- uses: actions/checkout@v4
|
|
233
|
-
|
|
278
|
+
|
|
279
|
+
- uses: scanaislop/aislop@v0.10.2
|
|
234
280
|
with:
|
|
235
|
-
|
|
236
|
-
- run: npx aislop@latest ci .
|
|
281
|
+
version: "0.10.2"
|
|
237
282
|
```
|
|
238
283
|
|
|
239
|
-
|
|
284
|
+
Manual workflow without the Marketplace Action:
|
|
240
285
|
|
|
241
286
|
```yaml
|
|
242
287
|
- uses: actions/checkout@v4
|
|
243
|
-
- uses:
|
|
288
|
+
- uses: actions/setup-node@v4
|
|
289
|
+
with:
|
|
290
|
+
node-version: 20
|
|
291
|
+
- run: npx --yes aislop@latest ci .
|
|
244
292
|
```
|
|
245
293
|
|
|
246
294
|
**GitHub code scanning (SARIF)**: emit a SARIF 2.1.0 report and upload it so findings appear in the Security tab:
|