|
113 | 113 | fix: "Ensure _destroyed is checked after the race resolves. Consider simpler alternatives." |
114 | 114 |
|
115 | 115 | # --- Deprecated APIs (blocking/advisory) --- |
| 116 | +# APIs removed or superseded in GNOME 45+. |
116 | 117 |
|
117 | 118 | - id: R-DEPR-04 |
118 | 119 | pattern: "\\bimports\\.(ui|gi|misc)\\." |
|
181 | 182 | fix: "Replace format() calls with template literals: `my ${variable} string`." |
182 | 183 |
|
183 | 184 | # --- Import segregation (blocking) --- |
| 185 | +# prefs.js runs in a separate process and cannot import Shell/Clutter/Meta/St. |
184 | 186 |
|
185 | 187 | - id: R-IMPORT-08 |
186 | 188 | pattern: "resource:///org/gnome/shell/ui/" |
|
191 | 193 | fix: "Preferences must only use GTK/Adw/Gio/GLib. Shell UI modules run in a different process." |
192 | 194 |
|
193 | 195 | # --- Security (blocking/advisory) --- |
| 196 | +# eval(), dynamic code, telemetry, insecure paths, privilege escalation. |
194 | 197 |
|
195 | 198 | - id: R-SEC-01 |
196 | 199 | pattern: "\\beval\\s*\\(" |
|
290 | 293 | fix: "If used legitimately (e.g., data URIs), add a comment explaining the purpose" |
291 | 294 |
|
292 | 295 | # --- Subprocess safety (blocking/advisory) --- |
| 296 | +# Synchronous spawning blocks the main loop; curl/gsettings via subprocess banned. |
293 | 297 |
|
294 | 298 | - id: R-SEC-14 |
295 | 299 | pattern: "\\bspawn_sync\\b" |
|
351 | 355 | fix: "Remove automatic package installation. Document manual installation steps for required system packages." |
352 | 356 |
|
353 | 357 | # --- Prefs.js GTK3 widget detection (blocking/advisory) --- |
| 358 | +# GTK3 widgets with direct Adwaita replacements should use the Adw equivalent. |
354 | 359 |
|
355 | 360 | - id: R-PREFS-04 |
356 | 361 | pattern: "\\bnew\\s+Gtk\\.(HeaderBar|StackSwitcher|Notebook|InfoBar)\\b" |
|
370 | 375 | fix: "Gtk.Grid → Adw rows, Gtk.ScrolledWindow → Adw.PreferencesPage (auto-scrolls), Gtk.Frame → Adw.PreferencesGroup, Gtk.ComboBoxText → Adw.ComboRow, Gtk.RadioButton → Adw.ActionRow, Gtk.Stack → Adw.ViewStack, Gtk.Revealer → Adw.ExpanderRow, Gtk.Expander → Adw.ExpanderRow, Gtk.FlowBox → Adw.PreferencesGroup, Gtk.ListBox → Adw.PreferencesGroup (for static lists)" |
371 | 376 |
|
372 | 377 | # --- Translation (advisory) --- |
| 378 | +# Template literals and concatenation inside gettext break xgettext extraction. |
373 | 379 |
|
374 | 380 | - id: R-I18N-01 |
375 | 381 | pattern: "_\\(\\`[^`]*\\$\\{" |
|
388 | 394 | fix: "Use _('Hello %s').format(name) instead of _('Hello ' + name)" |
389 | 395 |
|
390 | 396 | # --- Logging (advisory) --- |
| 397 | +# Legacy log()/print()/printerr() should use console.debug/error in GNOME 45+. |
391 | 398 |
|
392 | 399 | - id: R-LOG-02 |
393 | 400 | pattern: "(?<![.\\w])log\\s*\\(" |
|
406 | 413 | fix: "Replace print()/printerr() with console.debug() or console.error()." |
407 | 414 |
|
408 | 415 | # --- GSettings (advisory) --- |
| 416 | +# Common GSettings API misuse: wrong bind flag enum, missing settings cleanup. |
409 | 417 |
|
410 | 418 | - id: R-QUAL-23 |
411 | 419 | pattern: "\\.bind\\s*\\([^)]*GObject\\.BindingFlags" |
|
614 | 622 | fix: "Use Shell.ActionMode.NORMAL for most keybindings, or Shell.ActionMode.OVERVIEW | Shell.ActionMode.NORMAL for multi-mode" |
615 | 623 |
|
616 | 624 | # --- Code quality (advisory/blocking) --- |
| 625 | +# Module-scope GObject construction, unnecessary patterns, code smell detection. |
617 | 626 |
|
618 | 627 | - id: R-QUAL-04b |
619 | 628 | pattern: "^(let|var)\\s+\\w+\\s*=\\s*new\\s+(St|Gio|GLib|Clutter|Meta|Shell|GObject)\\." |
|
680 | 689 | fix: "Remove ?version= from the import; only Soup, Gtk, Gdk, and Adw require version specifiers" |
681 | 690 |
|
682 | 691 | # --- GNOME 44-46 migration (version-gated) --- |
| 692 | +# APIs removed or renamed in GNOME 44-46 transition to ESM. |
683 | 693 |
|
684 | 694 | - id: R-VER44-01 |
685 | 695 | pattern: "\\bMeta\\.later_add\\b" |
|
763 | 773 | min-version: 46 |
764 | 774 |
|
765 | 775 | # --- GNOME 47 migration (version-gated) --- |
| 776 | +# Clutter.Color removed in GNOME 47; use Cogl.Color. |
766 | 777 |
|
767 | 778 | - id: R-VER47-01 |
768 | 779 | pattern: "\\bClutter\\.Color\\b" |
|
774 | 785 | min-version: 47 |
775 | 786 |
|
776 | 787 | # --- GNOME 48 migration (version-gated) --- |
| 788 | +# Clutter.Image, Meta display functions, CSS class renames. |
777 | 789 |
|
778 | 790 | - id: R-VER48-01 |
779 | 791 | pattern: "\\bClutter\\.Image\\b" |
|
849 | 861 | replacement-pattern: "quick-toggle-has-menu" |
850 | 862 |
|
851 | 863 | # --- GNOME 49 migration (version-gated) --- |
| 864 | +# Clutter action classes replaced by gesture equivalents; Meta.Rectangle → Mtk. |
852 | 865 |
|
853 | 866 | - id: R-VER49-01 |
854 | 867 | pattern: "\\bMeta\\.Rectangle\\b" |
|
0 commit comments