Commit 94ee60e
committed
fix(cli): narrow the target-file discriminator, drop double parse, reuse formatter
Addresses review feedback on #315:
- targetFileParseError's `.taskless/`-prefix carve-out reintroduced the
exact #300 bug on a path the carve-out itself was blind to: verifyValeRule
points runVale explicitly at `.taskless/rules/vale/<ruleId>/rule-tests`,
which is an explicit path, not a whole-project walk, so the `.taskless/**`
glob exclusion never applies there and Vale really does walk into it. A
malformed fixture reported a relative Path starting with
`.taskless/rules/vale/...`, which the carve-out misread as "not a target,"
so the retry never fired and verifyValeRule failed the whole rule instead
of excluding the one bad fixture. isAbsolute alone is the correct, and now
the only, discriminator — a rule/style path reached through StylesPath is
always absolute (pinned in vale-vendor-contract.test.ts), so any relative
Path is by construction one of the run's own targets, .taskless/ or not.
- The non-zero-exit branch in spawnVale parsed stderr twice: once by hand to
populate configError, once again inside describeValeStderr. Extracted
parseValeConfigError so both call sites share one parse.
- The "Vale rejected the configuration" branch (reached via a zero-exit
stdout payload, defensive/non-live per its own comment) built its message
by hand instead of reusing formatValeConfigError, so it skipped that
helper's multi-line cleanup and code-dedup logic.
Added a regression test in vale-verify.test.ts exercising verifyValeRule
with a malformed fail-fixture, mutation-checked by reinstating the removed
carve-out and confirming it fails with the pre-fix symptom
("expected a verification, got Vale failed").1 parent 3fb4b3e commit 94ee60e
2 files changed
Lines changed: 95 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
102 | 121 | | |
103 | 122 | | |
104 | 123 | | |
| |||
110 | 129 | | |
111 | 130 | | |
112 | 131 | | |
113 | | - | |
114 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
115 | 136 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
126 | 143 | | |
127 | 144 | | |
128 | 145 | | |
| |||
213 | 230 | | |
214 | 231 | | |
215 | 232 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
220 | 254 | | |
221 | 255 | | |
222 | 256 | | |
| |||
230 | 264 | | |
231 | 265 | | |
232 | 266 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | 267 | | |
240 | 268 | | |
241 | 269 | | |
| |||
342 | 370 | | |
343 | 371 | | |
344 | 372 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 373 | + | |
351 | 374 | | |
352 | 375 | | |
353 | 376 | | |
354 | | - | |
| 377 | + | |
355 | 378 | | |
356 | 379 | | |
357 | 380 | | |
| |||
400 | 423 | | |
401 | 424 | | |
402 | 425 | | |
403 | | - | |
404 | | - | |
405 | | - | |
| 426 | + | |
406 | 427 | | |
407 | 428 | | |
408 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
366 | 408 | | |
367 | 409 | | |
368 | 410 | | |
| |||
0 commit comments