@voidh4x0r/slopgate 0.1.8 → 0.1.9
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/CHANGELOG.md +12 -0
- package/README.md +7 -5
- package/dist/cli.js +1 -1
- package/dist/rules/python.js +8 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,18 @@ All notable changes to this project are documented here. The format follows [Kee
|
|
|
9
9
|
- Go and Rust grammars.
|
|
10
10
|
- VS Code diagnostics.
|
|
11
11
|
|
|
12
|
+
## [0.1.9] - 2026-11-22
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- Documented that a config `include` replaces the default Python/TS/JS pattern set, while CLI `--include` appends to it. `--verbose` now prints the effective include count so a reduced file set is visible.
|
|
16
|
+
- `py/noop-test` reuses the `function_definition` list already collected by the rule instead of walking the tree a second time for the helper index.
|
|
17
|
+
- Added `include-semantics` coverage: default 3 files, config `src/**` 2 files, CLI `--include src/**` 3 files, and verbose shows 11 patterns.
|
|
18
|
+
|
|
19
|
+
### Unchanged
|
|
20
|
+
- No runtime behavior change to include handling; this is documentation and visibility only.
|
|
21
|
+
- Benchmark remains **29 high-confidence findings across 991,705 lines of CPython, 96.6% labeled precision (28/29), 14/14 seeded defects, 0 high findings on 601 JavaScript files**; `staleLabels: []`, `unlabeledHigh: []`.
|
|
22
|
+
- 255 tests.
|
|
23
|
+
|
|
12
24
|
## [0.1.8] - 2026-11-22
|
|
13
25
|
|
|
14
26
|
### Fixed
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ AI writes code that *looks* right. `slopgate` finds the parts that only look rig
|
|
|
14
14
|
```console
|
|
15
15
|
$ npx @voidh4x0r/slopgate .
|
|
16
16
|
|
|
17
|
-
slopgate 0.1.
|
|
17
|
+
slopgate 0.1.9 · 4 files · 39ms
|
|
18
18
|
|
|
19
19
|
app.py
|
|
20
20
|
4:1 error high py/phantom-import `helper` is imported but not declared in any manifest and not present in this repository
|
|
@@ -144,11 +144,13 @@ slopgate [path] [options]
|
|
|
144
144
|
}
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
- `include` / `exclude` — globs relative to the project root
|
|
147
|
+
- `include` / `exclude` — globs relative to the project root. **A config `include` replaces the default pattern set** (the ten Python/TS/JS globs); list every extension you still want. The CLI `--include` **appends** to the effective set, so `--include "src/**"` keeps the defaults.
|
|
148
148
|
- `ignoreModules` — top-level modules to always treat as declared (dynamic imports, private packages).
|
|
149
149
|
- `rules` — `"off"` or an explicit severity (`"error"`, `"warning"`, `"info"`).
|
|
150
150
|
- `confidence` / `failOn` — same meaning as the CLI flags; CLI flags win.
|
|
151
151
|
|
|
152
|
+
For example, `{"include": ["src/**"]}` scans only files under `src/`; it does **not** keep the default Python/TS/JS coverage. Add the patterns you need, or use the CLI flag to append one pattern to the defaults.
|
|
153
|
+
|
|
152
154
|
`slopgate init` writes a minimal config plus a GitHub Actions workflow.
|
|
153
155
|
|
|
154
156
|
### Adopting it on an existing repository
|
|
@@ -204,7 +206,7 @@ jobs:
|
|
|
204
206
|
- uses: actions/checkout@v4
|
|
205
207
|
- uses: actions/setup-node@v4
|
|
206
208
|
with: { node-version: 22 }
|
|
207
|
-
- run: npx --yes @voidh4x0r/slopgate@0.1.
|
|
209
|
+
- run: npx --yes @voidh4x0r/slopgate@0.1.9 . --fail-on high
|
|
208
210
|
```
|
|
209
211
|
|
|
210
212
|
For GitHub code scanning, use `--format sarif` and upload with `github/codeql-action/upload-sarif`.
|
|
@@ -212,7 +214,7 @@ For GitHub code scanning, use `--format sarif` and upload with `github/codeql-ac
|
|
|
212
214
|
For inline pull-request annotations **without** code scanning, use `--format github`, which emits [workflow commands](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions):
|
|
213
215
|
|
|
214
216
|
```yaml
|
|
215
|
-
- run: npx --yes @voidh4x0r/slopgate@0.1.
|
|
217
|
+
- run: npx --yes @voidh4x0r/slopgate@0.1.9 . --format github --fail-on high
|
|
216
218
|
```
|
|
217
219
|
|
|
218
220
|
Each finding becomes an `error` / `warning` / `notice` annotation on the exact line, followed by a summary notice.
|
|
@@ -297,7 +299,7 @@ Issues and pull requests are welcome. Start with [CONTRIBUTING.md](https://githu
|
|
|
297
299
|
git clone https://github.com/VoidH4x0r/slopgate
|
|
298
300
|
cd slopgate
|
|
299
301
|
npm install
|
|
300
|
-
npm test #
|
|
302
|
+
npm test # 255 tests; the tests themselves make no network or child-process calls
|
|
301
303
|
npm run typecheck
|
|
302
304
|
npm run verify # all release gates in one command
|
|
303
305
|
```
|
package/dist/cli.js
CHANGED
|
@@ -428,7 +428,7 @@ async function runScan(options, io) {
|
|
|
428
428
|
quiet: options.quiet,
|
|
429
429
|
}));
|
|
430
430
|
if (options.verbose) {
|
|
431
|
-
writeOut(io, ` config: ${configFile ?? '(none)'} baseline: ${baseline ? path.relative(process.cwd(), baselinePath) : '(none)'}` +
|
|
431
|
+
writeOut(io, ` config: ${configFile ?? '(none)'} include: ${merged.include.length} pattern(s) baseline: ${baseline ? path.relative(process.cwd(), baselinePath) : '(none)'}` +
|
|
432
432
|
(onlyDiff > 0 ? ` diff-only: ${onlyDiff} finding(s) outside the diff were ignored` : '') +
|
|
433
433
|
'\n');
|
|
434
434
|
}
|
package/dist/rules/python.js
CHANGED
|
@@ -112,9 +112,9 @@ function bodyCallsSelf(body) {
|
|
|
112
112
|
return found;
|
|
113
113
|
}
|
|
114
114
|
/** Lightweight name → node index; assertion checks happen on demand. */
|
|
115
|
-
function localFunctionDefinitions(
|
|
115
|
+
function localFunctionDefinitions(functions) {
|
|
116
116
|
const definitions = new Map();
|
|
117
|
-
for (const fn of
|
|
117
|
+
for (const fn of functions) {
|
|
118
118
|
if (fn.parent?.type === 'class_definition')
|
|
119
119
|
continue;
|
|
120
120
|
const name = fn.childForFieldName('name')?.text;
|
|
@@ -315,15 +315,17 @@ const noopTest = {
|
|
|
315
315
|
if (isStubFile(ctx.file))
|
|
316
316
|
return [];
|
|
317
317
|
const drafts = [];
|
|
318
|
-
// A test-dense file may have thousands of assertion-free tests.
|
|
319
|
-
//
|
|
318
|
+
// A test-dense file may have thousands of assertion-free tests. Reuse the
|
|
319
|
+
// function list the rule already collected; build the name index once, and
|
|
320
|
+
// only assert-check the helper actually called.
|
|
321
|
+
const functions = descendantsOfType(ctx.root, ['function_definition']);
|
|
320
322
|
let definitionIndex;
|
|
321
323
|
const definitions = () => {
|
|
322
|
-
definitionIndex ??= localFunctionDefinitions(
|
|
324
|
+
definitionIndex ??= localFunctionDefinitions(functions);
|
|
323
325
|
return definitionIndex;
|
|
324
326
|
};
|
|
325
327
|
const helperAssertions = new Map();
|
|
326
|
-
for (const fn of
|
|
328
|
+
for (const fn of functions) {
|
|
327
329
|
const name = testFunctionName(fn);
|
|
328
330
|
if (!name)
|
|
329
331
|
continue;
|