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
docs(ego-lint): update rule docs and docstrings for isLocked exemption
Sync rules-reference.md and check-quality.py docstrings with the
behavioral changes: R-QUAL-02 now only flags currentMode comparisons
(isLocked exempt), session-modes-consistency narrowed to currentMode,
and R-QUAL-11 threshold updated from 40% to 50%.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: skills/ego-lint/references/rules-reference.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -921,9 +921,9 @@ Heuristic rules that detect code patterns commonly seen in AI-generated or over-
921
921
### R-QUAL-02: Impossible state checks
922
922
-**Severity**: advisory
923
923
-**Checked by**: check-quality.py
924
-
-**Rule**: Extension code should not check for states that are impossible given its configuration. For example, checking`Main.sessionMode.isLocked`without declaring `unlock-dialog` in `session-modes`.
925
-
-**Rationale**: If the extension does not declare `unlock-dialog` in `session-modes`, it is never active on the lock screen, so checking lock state is dead code. This pattern is common in AI-generated extensions that copy-paste lock-screen handling without understanding when it applies.
926
-
-**Fix**: Either add `"unlock-dialog"` to `session-modes` in `metadata.json` (if lock-screen support is intended) or remove the lock-state checking code.
924
+
-**Rule**: Extension code should not check for states that are impossible given its configuration. For example, comparing`Main.sessionMode.currentMode` with `'unlock-dialog'`without declaring `unlock-dialog` in `session-modes`. Note: `sessionMode.isLocked` is exempt — reading lock state is always a defensive guard pattern, not evidence of lock screen functionality.
925
+
-**Rationale**: If the extension does not declare `unlock-dialog` in `session-modes`, it is never active on the lock screen, so checking `currentMode` against lock-screen values is dead code. This pattern is common in AI-generated extensions that copy-paste lock-screen handling without understanding when it applies.
926
+
-**Fix**: Either add `"unlock-dialog"` to `session-modes` in `metadata.json` (if lock-screen support is intended) or remove the `currentMode` comparison code.
927
927
928
928
### R-QUAL-03: Over-engineered async coordination
929
929
-**Severity**: advisory
@@ -1561,7 +1561,7 @@ destroy() {
1561
1561
### R-QUAL-11: Comment Density
1562
1562
- **Severity**: advisory
1563
1563
- **Checked by**: check-quality.py
1564
-
- **Rule**: Flags files where >40% of lines (after first 10) are comments.
1564
+
- **Rule**: Flags files where >50% of lines (after first 10) are comments.
1565
1565
- **Rationale**: Excessive comments explaining obvious code is a strong AI slop signal.
1566
1566
- **Fix**: Remove redundant comments. Only keep comments that explain non-obvious logic or API quirks.
@@ -1952,7 +1952,7 @@ Rules for APIs removed or changed in specific GNOME Shell versions. These rules
1952
1952
### metadata/session-modes-consistency: SessionMode usage without declaration
1953
1953
- **Severity**: advisory
1954
1954
- **Checked by**: check-metadata.py
1955
-
- **Rule**: Warns if the extension code references `Main.sessionMode.currentMode` or `sessionMode.isLocked` but `metadata.json` does not declare `session-modes` with `unlock-dialog`.
1955
+
- **Rule**: Warns if the extension code references `Main.sessionMode.currentMode` but `metadata.json` does not declare `session-modes` with `unlock-dialog`. Note: `sessionMode.isLocked` is exempt — reading lock state is a defensive guard, not evidence of lock screen usage.
1956
1956
- **Rationale**: Code that checks session mode without the proper declaration is either dead code (the extension won't run in lock screen mode) or a misunderstanding of the lifecycle.
1957
1957
-**Fix**: Either add `"session-modes": ["user", "unlock-dialog"]` to metadata.json, or remove the session mode checks from the code.
0 commit comments