Commit 5e86aa6
fix(ego-lint): scope init/shell-modification to Extension class constructors (#140)
## Summary
- Add `find_extension_class_range()` to identify the Extension class
body in `extension.js` (via `extends Extension` or `export default
class` fallback)
- Pass the class range to `extract_constructor_lines()` so only the
Extension class constructor is checked — helper class constructors in
the same file are skipped
- Fixes 5 FPs across field tests where helper classes (instantiated at
runtime from `enable()`) had their constructors incorrectly flagged
## Test plan
- [x] New fixture `init-helper-in-extension@test` with both Extension
class (TP) and helper class (no FP) constructors
- [x] New assertions verify Extension constructor is flagged (line 20)
and helper constructor is not (line 8)
- [x] All 744 existing test assertions pass
- [x] Existing init fixtures (`init-constructor-signal`,
`gobject-class-init`, `init-time-safety`) produce identical results
Closes #136
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3fc9655 commit 5e86aa6
File tree
6 files changed
+100
-6
lines changed- skills/ego-lint
- references
- scripts
- tests
- assertions
- fixtures/init-helper-in-extension@test
6 files changed
+100
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1318 | 1318 | | |
1319 | 1319 | | |
1320 | 1320 | | |
1321 | | - | |
| 1321 | + | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | | - | |
| 1324 | + | |
1325 | 1325 | | |
1326 | 1326 | | |
1327 | 1327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
| |||
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
117 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
118 | 156 | | |
119 | 157 | | |
120 | 158 | | |
121 | 159 | | |
122 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
123 | 164 | | |
124 | 165 | | |
125 | 166 | | |
| |||
147 | 188 | | |
148 | 189 | | |
149 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
150 | 194 | | |
151 | 195 | | |
152 | 196 | | |
| |||
248 | 292 | | |
249 | 293 | | |
250 | 294 | | |
251 | | - | |
252 | | - | |
| 295 | + | |
| 296 | + | |
253 | 297 | | |
254 | 298 | | |
255 | | - | |
| 299 | + | |
| 300 | + | |
256 | 301 | | |
257 | 302 | | |
258 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 31 additions & 0 deletions
| 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 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments