Skip to content

Commit ad1830c

Browse files
author
Solomon
committed
fix(ego-lint): remove Meta.Cursor from R-SLOP-08 hallucinated API pattern
Meta.Cursor IS a valid GJS enum (cursor shapes used with global.display.set_cursor()). Only Meta.Screen is nonexistent (removed in GNOME 40). Including Meta.Cursor caused false positives on extensions like PaperWM that legitimately use cursor shape enum values (e.g. Meta.Cursor.GRABBING, Meta.Cursor.MOVE_OR_RESIZE_WINDOW). Also update the message and fix text to only reference Meta.Screen. Closes #155
1 parent 9c6759b commit ad1830c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rules/patterns.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,12 @@
644644
# LLMs frequently call methods that don't exist in GJS/GNOME Shell.
645645

646646
- id: R-SLOP-08
647-
pattern: "\\b(Meta\\.Screen|Meta\\.Cursor|Shell\\.WindowTracker\\.get_default\\(\\)\\.get_active_window)"
647+
pattern: "\\b(Meta\\.Screen|Shell\\.WindowTracker\\.get_default\\(\\)\\.get_active_window)"
648648
scope: ["*.js"]
649649
severity: advisory
650-
message: "Likely hallucinated API — Meta.Screen and Meta.Cursor do not exist"
650+
message: "Likely hallucinated API — Meta.Screen does not exist; use Meta.Display or global.display"
651651
category: ai-slop
652-
fix: "Check the GJS API docs: https://gjs-docs.gnome.org. Use Meta.Display, global.display, etc."
652+
fix: "Check the GJS API docs: https://gjs-docs.gnome.org. Use Meta.Display, global.display.get_monitor_geometry() etc."
653653

654654
- id: R-SLOP-09
655655
pattern: "\\bSt\\.(Button|Label|Widget)\\.(set_label|set_text|set_icon_name)\\s*\\("

0 commit comments

Comments
 (0)