Commit d7051cf
fix(ego-lint): add replacement-pattern to R-VER rules for version-compat suppression (#84)
## Summary
- Add file-level `replacement-pattern` to 4 version-compat rules
(R-VER44-02, R-VER46-04, R-VER49-08, R-VER49-11) to suppress findings
when the replacement API is present in the same file
- Skip 3 rules where the replacement API is too common for file-level
suppression (R-VER46-01, R-VER46-02, R-VER46-07)
- Add test fixture `ver-replacement-compat@test` with 4 assertions
verifying suppression
### Rules updated
| Rule | Deprecated API | replacement-pattern | Rationale |
|------|---|---|---|
| R-VER44-02 | `Meta.later_remove` | `get_laters` | New API path
`get_laters().removeLater()` |
| R-VER46-04 | `Gio.UnixInputStream` | `GioUnix` | New module name |
| R-VER49-08 | `maximize(MaximizeFlags)` | `set_maximize_flags` | New
API for flag setting |
| R-VER49-11 | `unmaximize(MaximizeFlags)` | `set_maximize_flags` | Same
new API |
### Rules skipped (replacement API too common)
| Rule | Why |
|------|-----|
| R-VER46-01 `.add_actor()` | `add_child` ubiquitous in extensions |
| R-VER46-02 `.remove_actor()` | `remove_child` ubiquitous in extensions
|
| R-VER46-07 `Clutter.Container` | No specific replacement;
`Clutter.Actor` everywhere |
## Test plan
- [x] `bash tests/run-tests.sh` — 607 passed, 0 failed
- [x] New `ver-replacement-compat@test` fixture verifies all 4 rules
suppressed when replacement API present
- [x] Existing `gnome46-compat`, `gnome48-compat`, `gnome49-compat`
fixtures still FAIL correctly (no replacement APIs in those files)
Closes #74
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0d2df8d commit d7051cf
File tree
5 files changed
+65
-0
lines changed- rules
- tests
- fixtures/ver-replacement-compat@test
5 files changed
+65
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
| 815 | + | |
815 | 816 | | |
816 | 817 | | |
817 | 818 | | |
| |||
823 | 824 | | |
824 | 825 | | |
825 | 826 | | |
| 827 | + | |
826 | 828 | | |
827 | 829 | | |
828 | 830 | | |
| |||
862 | 864 | | |
863 | 865 | | |
864 | 866 | | |
| 867 | + | |
865 | 868 | | |
866 | 869 | | |
867 | 870 | | |
| |||
1065 | 1068 | | |
1066 | 1069 | | |
1067 | 1070 | | |
| 1071 | + | |
1068 | 1072 | | |
1069 | 1073 | | |
1070 | 1074 | | |
| |||
1094 | 1098 | | |
1095 | 1099 | | |
1096 | 1100 | | |
| 1101 | + | |
1097 | 1102 | | |
1098 | 1103 | | |
1099 | 1104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
456 | 466 | | |
457 | 467 | | |
458 | 468 | | |
| |||
0 commit comments