Commit a989d26
authored
refactor(derive): remove clap compatibility spellings
## Summary
- require `#[usage(...)]` metadata across usage CLI derives and emit
targeted errors for legacy clap helper namespaces
- reject clap-only inner synonyms with their native replacements and
remove implicit clap group generation
- migrate derive fixtures, conformance coverage, generated shadows,
rustdoc, and migration documentation to native syntax
## Testing
- `cargo test -p usage-derive`
- `cargo test -p usage-rs --all-features --tests`
- `cargo test -p usage-conformance --all-features`
- `cargo test -p xtask`
- `cargo test --all --all-features`
- `mise run gen-shadow`
- `mise run ci`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Breaking public derive API: clap-compatible attributes and implicit
Args groups no longer compile. Runtime parse behavior is otherwise
unchanged.
>
> **Overview**
> **Breaking:** usage CLI derives now accept only native `#[usage(...)]`
metadata. `#[command]`, `#[arg]`, `#[value]`, and `#[group]` are still
registered so they fail at the source span with a rewrite to
`#[usage(...)]`. Inner clap synonyms (`id`, `default_value`,
`conflicts_with`, `value_parser`, `last`, etc.) are rejected the same
way.
>
> Implicit clap `#[group(...)]` generation is gone. Requiredness comes
only from field types/`required`, not one-member implicit groups.
>
> Docs, README, conformance tests, and generated shadow CLIs are
rewritten to native syntax. Clap migration examples are explicit
before/after rewrites rather than “keep the old spelling.”
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
840fd41. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added comprehensive support for native `#[usage(...)]` CLI metadata
across commands, arguments, values, aliases, groups, and subcommands.
* Improved handling of required flags and argument groups, including
single-member groups.
* **Bug Fixes**
* Legacy attribute spellings now provide clearer replacement guidance
when unsupported.
* **Documentation**
* Updated migration and subcommand guides with native syntax and
expanded behavior examples.
* **Tests**
* Updated conformance and compatibility coverage for native attribute
behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 4bddddb commit a989d26
26 files changed
Lines changed: 970 additions & 1104 deletions
File tree
- benches/shadows
- aube/src
- external-fd/src
- external-starship/src
- external-tokei/src
- fnox/src
- hk/src
- mise/src
- pitchfork/src
- conformance/tests
- derive/src
- docs/rust
- usage-rs/tests
- xtask/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 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 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
16 | 51 | | |
17 | 52 | | |
18 | 53 | | |
| |||
21 | 56 | | |
22 | 57 | | |
23 | 58 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
28 | 63 | | |
29 | 64 | | |
30 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | | - | |
| 541 | + | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
544 | 544 | | |
545 | | - | |
| 545 | + | |
546 | 546 | | |
547 | | - | |
| 547 | + | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
| 554 | + | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
907 | | - | |
| 907 | + | |
908 | 908 | | |
909 | 909 | | |
910 | | - | |
| 910 | + | |
911 | 911 | | |
912 | 912 | | |
913 | | - | |
| 913 | + | |
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| |||
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
967 | | - | |
| 967 | + | |
968 | 968 | | |
969 | 969 | | |
970 | | - | |
| 970 | + | |
971 | 971 | | |
972 | 972 | | |
973 | | - | |
| 973 | + | |
974 | 974 | | |
975 | 975 | | |
976 | | - | |
| 976 | + | |
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
| |||
1008 | 1008 | | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
| 1011 | + | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | | - | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
| 1017 | + | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | | - | |
| 1020 | + | |
1021 | 1021 | | |
1022 | 1022 | | |
1023 | 1023 | | |
| |||
1051 | 1051 | | |
1052 | 1052 | | |
1053 | 1053 | | |
1054 | | - | |
| 1054 | + | |
1055 | 1055 | | |
1056 | 1056 | | |
1057 | | - | |
| 1057 | + | |
1058 | 1058 | | |
1059 | 1059 | | |
1060 | | - | |
| 1060 | + | |
1061 | 1061 | | |
1062 | 1062 | | |
1063 | 1063 | | |
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
1102 | | - | |
| 1102 | + | |
1103 | 1103 | | |
1104 | 1104 | | |
1105 | | - | |
| 1105 | + | |
1106 | 1106 | | |
1107 | 1107 | | |
1108 | | - | |
| 1108 | + | |
1109 | 1109 | | |
1110 | 1110 | | |
1111 | | - | |
| 1111 | + | |
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
| |||
2134 | 2134 | | |
2135 | 2135 | | |
2136 | 2136 | | |
2137 | | - | |
| 2137 | + | |
2138 | 2138 | | |
2139 | 2139 | | |
2140 | | - | |
| 2140 | + | |
2141 | 2141 | | |
2142 | 2142 | | |
2143 | | - | |
| 2143 | + | |
2144 | 2144 | | |
2145 | 2145 | | |
2146 | | - | |
| 2146 | + | |
2147 | 2147 | | |
2148 | 2148 | | |
2149 | 2149 | | |
| |||
2625 | 2625 | | |
2626 | 2626 | | |
2627 | 2627 | | |
2628 | | - | |
| 2628 | + | |
2629 | 2629 | | |
2630 | | - | |
| 2630 | + | |
2631 | 2631 | | |
2632 | | - | |
| 2632 | + | |
2633 | 2633 | | |
2634 | 2634 | | |
2635 | 2635 | | |
| |||
2766 | 2766 | | |
2767 | 2767 | | |
2768 | 2768 | | |
2769 | | - | |
| 2769 | + | |
2770 | 2770 | | |
2771 | | - | |
| 2771 | + | |
2772 | 2772 | | |
2773 | | - | |
| 2773 | + | |
2774 | 2774 | | |
2775 | 2775 | | |
2776 | 2776 | | |
| |||
2825 | 2825 | | |
2826 | 2826 | | |
2827 | 2827 | | |
2828 | | - | |
| 2828 | + | |
2829 | 2829 | | |
2830 | | - | |
| 2830 | + | |
2831 | 2831 | | |
2832 | | - | |
| 2832 | + | |
2833 | 2833 | | |
2834 | 2834 | | |
2835 | 2835 | | |
| |||
3916 | 3916 | | |
3917 | 3917 | | |
3918 | 3918 | | |
3919 | | - | |
| 3919 | + | |
3920 | 3920 | | |
3921 | | - | |
| 3921 | + | |
3922 | 3922 | | |
3923 | 3923 | | |
3924 | 3924 | | |
| |||
4009 | 4009 | | |
4010 | 4010 | | |
4011 | 4011 | | |
4012 | | - | |
| 4012 | + | |
4013 | 4013 | | |
4014 | 4014 | | |
4015 | | - | |
| 4015 | + | |
4016 | 4016 | | |
4017 | 4017 | | |
4018 | | - | |
| 4018 | + | |
4019 | 4019 | | |
4020 | 4020 | | |
4021 | 4021 | | |
| |||
5245 | 5245 | | |
5246 | 5246 | | |
5247 | 5247 | | |
5248 | | - | |
| 5248 | + | |
5249 | 5249 | | |
5250 | | - | |
| 5250 | + | |
5251 | 5251 | | |
5252 | | - | |
| 5252 | + | |
5253 | 5253 | | |
5254 | | - | |
| 5254 | + | |
5255 | 5255 | | |
5256 | | - | |
| 5256 | + | |
5257 | 5257 | | |
5258 | | - | |
| 5258 | + | |
5259 | 5259 | | |
5260 | 5260 | | |
5261 | 5261 | | |
5262 | 5262 | | |
5263 | 5263 | | |
5264 | | - | |
| 5264 | + | |
5265 | 5265 | | |
5266 | | - | |
| 5266 | + | |
5267 | 5267 | | |
5268 | | - | |
| 5268 | + | |
5269 | 5269 | | |
5270 | | - | |
| 5270 | + | |
5271 | 5271 | | |
5272 | 5272 | | |
5273 | 5273 | | |
| |||
0 commit comments