feat(parse): preserve trailing delimiters - #1098
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 |
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 054db7f. Configure here.
054db7f to
616fcfc
Compare
Instruction counts
No instruction-count regression above 1%. 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
|

Summary
dont_delimit_trailing_valuescommand policy to KDL and typed Rust metadata--and on automatic trailing positionals across usage-lib, usage-argv, and generated/direct GoValidation
cargo test --all --all-featurescd go && go test ./...mise run lintmise run gen-shadowmise run gen-gomise run renderThis PR was generated by Codex.
Note
Medium Risk
Changes core argv binding and delimiter handling in Rust and Go across derive, parsers, and generated code; behavior is well covered by tests but mistakes could affect many CLIs that use delimiters or trailing
--forwarding.Overview
Implements clap's
dont_delimit_trailing_valuesas an inherited, command-wide policy that round-trips through KDL, usage-lib, the typed derive, usage-argv, generated Go, and the clap bridge (no longer a fidelity loss).Parsing behavior: After
--or once an automatic trailing positional starts, variadic positionals stop splitting ondelimiter(e.g.a,b -- c,d→a,b,c,d). Ordinary tokens before that boundary still split. Subcommands inherit the policy from ancestors.API shift:
Event::Arggains adelimitflag; Rust derive and Go binders honor it when expanding values (and drop the derive's old post-checkdelimiter split pass). Go also threadsDelimiteron flags/args, counts delimited pieces for variadic flags, and usesSplitValuein conformance and generated parsers.Docs, PLAN, corpus, and conformance tests cover inheritance and KDL round-trip.
Reviewed by Cursor Bugbot for commit 616fcfc. Bugbot is set up for automated code reviews on this repo. Configure here.