Commit 33dda62
feat(lint): add more lint checks (#446)
## Summary
Adds new lint checks and improves error messages:
### New checks:
| Code | Severity | Description |
|------|----------|-------------|
| `subcommand-required-no-subcommands` | error | Command has
`subcommand_required=true` but no subcommands defined |
| `variadic-arg-not-last` | warning | Variadic argument is not the last
argument |
| `count-flag-with-arg` | error | Count flag also has an argument
(conflicting semantics) |
### Improvements:
- `invalid-default-subcommand` error now shows the list of valid
subcommands
### Example output:
```
error [invalid-default-subcommand]: default_subcommand 'nonexistent' does not exist (valid subcommands: install, update)
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds additional validation and clearer errors in CLI spec linting.
>
> - New checks:
> - `subcommand-required-no-subcommands` (error):
`subcommand_required=true` but no subcommands
> - `variadic-arg-not-last` (warning): variadic arg appears before the
last position
> - `count-flag-with-arg` (error): count flag also has an argument
> - Improves `invalid-default-subcommand` to include valid subcommands
in the message
> - Extends test coverage for all new behaviors
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ab08e6e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.5 <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent 5e030b1 commit 33dda62
1 file changed
+100
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
183 | 193 | | |
184 | 194 | | |
185 | 195 | | |
| |||
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
264 | 286 | | |
265 | 287 | | |
266 | 288 | | |
| |||
314 | 336 | | |
315 | 337 | | |
316 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
317 | 352 | | |
318 | 353 | | |
319 | 354 | | |
| |||
432 | 467 | | |
433 | 468 | | |
434 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
435 | 535 | | |
0 commit comments