Skip to content

Commit ec45dc7

Browse files
ZviBaratzclaude
andcommitted
fix(ego-lint): anchor R-SLOP-24 desktop guard to string literals and fix annotation notes
Tighten the `desktop\.` alternative in the R-SLOP-24 guard-pattern to `['"]desktop\.` so it only matches string-literal contexts (system schema IDs), not incidental occurrences like `desktop.png` or `this.desktop.theme`. Fix dash-to-panel annotation to accurately note that the R-SLOP-24 FPs were already suppressed by the existing guard-window-forward: 5 mechanism, rather than crediting PR #139 specifically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fe97444 commit ec45dc7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

field-tests/annotations/dash-to-panel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ findings:
7373
# WARNs — False Positives
7474
- id: "R-SLOP-24::new Gio.Settings for system schemas"
7575
classification: resolved
76-
notes: "5 hits — desktop.interface, desktop.notifications, shell.app-switcher, KEYBINDINGS_SCHEMA. Resolved by PR #139 (guard expansion for bare system schema identifiers)."
76+
notes: "5 hits — desktop.interface, desktop.notifications, shell.app-switcher, KEYBINDINGS_SCHEMA. Already suppressed by existing guard-window-forward: 5 mechanism. PR #139 adds additional coverage for edge cases (enumerated _SCHEMA constants, string-anchored desktop. guard)."
7777
- id: "R-SLOP-01::JSDoc despite provenance score 4"
7878
classification: expected
7979
notes: "5 hits — suppressed by provenance post-filter (score 4 >= 3 threshold). Fixed in deferred approach."

rules/patterns.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@
694694
message: "new Gio.Settings() is incorrect in GNOME 45+; use this.getSettings() from Extension base class"
695695
category: ai-slop
696696
fix: "Use this.getSettings() in Extension subclass or this.getSettings() in ExtensionPreferences"
697-
guard-pattern: "schema.*org\\.gnome\\.(?!shell\\.extensions\\.)|desktop\\.|shell\\.app-switcher|(?:KEYBINDINGS|NOTIFICATIONS|DESKTOP|INTERFACE|WM|MUTTER|APP_SWITCHER)_SCHEMA"
697+
guard-pattern: "schema.*org\\.gnome\\.(?!shell\\.extensions\\.)|['\"]desktop\\.|shell\\.app-switcher|(?:KEYBINDINGS|NOTIFICATIONS|DESKTOP|INTERFACE|WM|MUTTER|APP_SWITCHER)_SCHEMA"
698698
guard-window-forward: 5
699699
exclude-dirs: ["service"]
700700

skills/ego-lint/references/rules-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ Rules for APIs removed or changed in specific GNOME Shell versions. These rules
22332233
- **Rule**: `new Gio.Settings()` should not be used in GNOME 45+ extensions.
22342234
- **Rationale**: The `Extension` base class provides `this.getSettings()` which uses the correct schema path automatically. Manually constructing `Gio.Settings` requires specifying the schema ID and may use the wrong compiled schema path.
22352235
- **Fix**: Use `this.getSettings()` in the Extension subclass, or pass a schema ID: `this.getSettings('org.gnome.shell.extensions.my-ext')`.
2236-
- **Guard**: Suppressed when `schema.*org.gnome.` (excluding `shell.extensions.`), bare system schema substrings (`desktop.`, `shell.app-switcher`), or enumerated system-schema constants (`KEYBINDINGS_SCHEMA`, `NOTIFICATIONS_SCHEMA`, `DESKTOP_SCHEMA`, `INTERFACE_SCHEMA`, `WM_SCHEMA`, `MUTTER_SCHEMA`, `APP_SWITCHER_SCHEMA`) appear on the match line or within a 5-line forward window. Also skipped in `service/` directories.
2236+
- **Guard**: Suppressed when `schema.*org.gnome.` (excluding `shell.extensions.`), string-literal-anchored system schema substrings (`'desktop.` or `"desktop.`), bare `shell.app-switcher`, or enumerated system-schema constants (`KEYBINDINGS_SCHEMA`, `NOTIFICATIONS_SCHEMA`, `DESKTOP_SCHEMA`, `INTERFACE_SCHEMA`, `WM_SCHEMA`, `MUTTER_SCHEMA`, `APP_SWITCHER_SCHEMA`) appear on the match line or within a 5-line forward window. The `desktop.` anchor requires a quote prefix to avoid matching non-schema contexts like `desktop.png` or `this.desktop.theme`. Also skipped in `service/` directories.
22372237

22382238
### R-SLOP-25: Main.extensionManager.enable/disable
22392239
- **Severity**: advisory

0 commit comments

Comments
 (0)