feat(parse): support non-strict choices - #1127
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a0d294d to
26a9fe2
Compare
26a9fe2 to
a0c35ce
Compare
a0c35ce to
8a4d8e5
Compare
8a4d8e5 to
a5852ac
Compare
91805ce to
0c409bd
Compare
Instruction counts
1 benchmark(s) above the 1% gate: Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes. Shadow comparisonParsing
|
0c409bd to
6f7ee6f
Compare
6f7ee6f to
8439fec
Compare
dc24d1e to
5226b58
Compare
2b59c67 to
f7d2009
Compare
f7d2009 to
2b59c67
Compare
2b59c67 to
60f0908
Compare
60f0908 to
016c904
Compare
016c904 to
b13e3b7
Compare
016c904 to
b13e3b7
Compare
b13e3b7 to
a8d5eaf
Compare
a8d5eaf to
434930e
Compare
Summary
choices strict=#falseand typedchoices_strict = falsedeclarationsValueEnumdeclarations because an unknown word cannot construct an enum variantVerification
mise run ciNote
Medium Risk
Changes post-parse choice validation across Rust and Go parsers. Default remains strict, so existing CLIs are unaffected unless they opt in.
Overview
Adds non-strict choices: declared values remain suggestions for help and completion, while values outside the list are accepted. Strict validation stays the default.
KDL uses
choices strict=#false …; the derive useschoices_strict = falseon a string-like field withchoices(...). The policy is carried through usage-lib, argv metadata, generated Go tables, and KDL emission. Combining it withvalue_enumis a compile error, since an unknown word cannot construct an enum variant.Docs and the clap matrix record this as usage-only (clap#5885).
Reviewed by Cursor Bugbot for commit 434930e. Bugbot is set up for automated code reviews on this repo. Configure here.