Repository navigation
Commit 5c19a47
fix(cli): count a fixture only when the file's own id is this rule
Three review findings on #156, all in the same shape: a claim stated
twice diverges, and the second copy is the one nobody reads.
`fixtureCoverage` counted a test file by filename alone, while
`sg test --filter ^<id>$` resolves cases against the file's `id:`
field. A draft copied from another rule — right filename, wrong `id:` —
had its buckets counted toward coverage while ast-grep never ran them,
reopening the "never shown to fire" gap this branch exists to close
through the filename door rather than the empty-bucket one.
The "what counts as this rule's test file" predicate was also written
twice in one `verifyRule()` pass. It now lives in one
`discoverRuleTestFiles` used by both `validateRequirements` and
`fixtureCoverage`.
Also drops the duplicate `describe("the language field")` suite that the
rebase left behind. The base branch carries the fuller three-test
version; commit 44f4850 removed the duplicate `atLanguage` helper but
missed the suite itself.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cyga14bww8rmazH2XrF8ms1 parent 44f4850 commit 5c19a47
3 files changed
Lines changed: 71 additions & 65 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 168 | + | |
| 169 | + | |
179 | 170 | | |
180 | 171 | | |
181 | 172 | | |
| |||
186 | 177 | | |
187 | 178 | | |
188 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
189 | 213 | | |
190 | 214 | | |
191 | 215 | | |
| |||
209 | 233 | | |
210 | 234 | | |
211 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
212 | 244 | | |
213 | 245 | | |
214 | 246 | | |
215 | 247 | | |
216 | 248 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 249 | | |
226 | 250 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 251 | + | |
231 | 252 | | |
232 | 253 | | |
233 | | - | |
| 254 | + | |
234 | 255 | | |
235 | 256 | | |
236 | 257 | | |
| |||
242 | 263 | | |
243 | 264 | | |
244 | 265 | | |
| 266 | + | |
245 | 267 | | |
246 | 268 | | |
247 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | 658 | | |
700 | 659 | | |
701 | 660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
464 | 489 | | |
465 | 490 | | |
466 | 491 | | |
| |||
0 commit comments