You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ego-lint): reduce Media Controls false positives (#23)
## Summary
- **onDestroy() recognized as cleanup**: `build-resource-graph.py` now
detects `onDestroy()` alongside `destroy()`, `disable()`, and
`_destroy*()` — eliminates 45 FP WARNs from Media Controls
- **Provenance threshold lowered 4→3**: Score 3 means strong
hand-written indicators (domain vocabulary, nontrivial algorithms). AI
code scores 1-2. Eliminates 173 FP R-SLOP-01/02 WARNs
Closes#17
## Test plan
- [x] New fixture: `on-destroy-cleanup@test` with widget using
`onDestroy()` via `this.connect("destroy", ...)`
- [x] Assertion: no `resource-tracking/no-destroy-method` for widget
with onDestroy
- [x] `bash tests/run-tests.sh` passes (512 assertions)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: skills/ego-lint/references/rules-reference.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -831,7 +831,7 @@ Rules that detect patterns commonly found in AI-generated extensions. These are
831
831
-**Rule**: JSDoc comments should not use TypeScript-style `@param {Type} name` annotations.
832
832
-**Rationale**: GNOME Shell extensions are plain JavaScript (not TypeScript). JSDoc type annotations in the `{Type}` format are a strong signal that code was generated by an AI trained primarily on TypeScript codebases. EGO reviewers recognize this pattern.
833
833
-**Fix**: Remove type annotations from JSDoc comments, or remove JSDoc entirely if the code is self-documenting. GJS does not process JSDoc types.
834
-
-**Provenance suppression**: When `quality/code-provenance` reports a score >= 4 (strong hand-written indicators), R-SLOP-01 warnings are automatically suppressed. High-provenance code uses JSDoc as intentional documentation, not AI slop. A `provenance/jsdoc-suppressed` PASS line is emitted instead.
834
+
-**Provenance suppression**: When `quality/code-provenance` reports a score >= 3 (moderate-to-high hand-written indicators), R-SLOP-01 warnings are automatically suppressed. Hand-written code uses JSDoc as intentional documentation, not AI slop. A `provenance/jsdoc-suppressed` PASS line is emitted instead.
- **Rule**: Module creates resources but has no `destroy()` or `disable()` method for cleanup.
2015
-
- **Fix**: Add a `destroy()` method that cleans up all resources.
2014
+
- **Rule**: Module creates resources but has no cleanup method (`destroy()`, `disable()`, or `onDestroy()`) for cleanup.
2015
+
- **Fix**: Add a `destroy()` method that cleans up all resources, or use `onDestroy()` connected via `this.connect('destroy', this.onDestroy.bind(this))`.
0 commit comments