Repository navigation
feat(parse): add subcommand requirement policy - #1103
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 |
31232ff to
94a8930
Compare
94a8930 to
3f833ab
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3f833ab. Configure here.
9b76d53 to
e1bf222
Compare
e1bf222 to
b95e100
Compare
b95e100 to
3a10ef1
Compare
3a10ef1 to
046ba8e
Compare
046ba8e to
06131c6
Compare
06131c6 to
a435fd0
Compare
a435fd0 to
5d43e16
Compare
Instruction countsNothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable — counts shift between machine types by more than a real regression does. New, nothing to compare against: 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
|
5d43e16 to
60f8384
Compare
60f8384 to
083a5e0
Compare
083a5e0 to
e0b2c29
Compare
e0b2c29 to
2588def
Compare
2588def to
1d8566e
Compare
1d8566e to
3d9fe17
Compare

Summary
subcommand_negates_reqsacross KDL, derive, argv, clap conversion, and generated GoVerification
cargo test --all --all-featurescargo clippy --all --all-features -- -D warningsgo test ./...(fromgo/)AI-generated pull request.
Note
Medium Risk
Touches post-parse validation across usage-lib, derive codegen, and generated Go parsers; incorrect gating could hide real missing-arg errors or leave conflicts broken, though tests cover the main cases.
Overview
Adds
subcommand_negates_reqs(clap’ssubcommand_negates_reqs) end-to-end: KDL/spec,usage_argv::Command, derive#[command(subcommand_negates_reqs)], clap bridge import, conformance tables, and docs/migration notes. PLAN marks this parsing policy as done.Runtime behavior: when a child subcommand is selected, positive requirements on ancestor commands are skipped—required args/flags, groups,
requires/required_if, and similar—while conflicts and the child’s own requirements still run. usage-lib gates checks withrequirements_applyover the command chain; the derive skips requirement checks whenpartial.__usage_selectedis set; generated Go builds a per-entryrequirementsmap and usesCheckRelationshipsWithValuesAndRequirements, clearingRequiredon suppressed entries.Fidelity:
SubcommandNegatesRequirementsis removed from the clap loss report because the bridge now preserves the setting. Derive validation allowsrequiredonOptionfields when this policy is enabled on the parent.Reviewed by Cursor Bugbot for commit 3d9fe17. Bugbot is set up for automated code reviews on this repo. Configure here.