Skip to content

fix(cli): stop scanning pest, rubocop, rspec, and go options past -- - #4969

Open
CG-5228 wants to merge 1 commit into
rtk-ai:developfrom
CG-5228:fix/stop-option-scan-at-dashdash
Open

CG-5228 wants to merge 1 commit into
rtk-ai:developfrom
CG-5228:fix/stop-option-scan-at-dashdash

Conversation

@CG-5228

@CG-5228 CG-5228 commented Nov 3, 2026

Copy link
Copy Markdown

Summary

  • Stop option detection in pest_cmd, rubocop_cmd, rspec_cmd, and go_cmd from scanning past a -- end-of-options separator (#4920).
  • Bound pest_cmd (has_no_progress_flag) and go_cmd (has_golangci_format_flag) option scans using arg_tokenizer::before_dashdash(&arg_tokenizer::tokenize(args)).
  • Bound rubocop_cmd (is_autocorrect_flag, has_format_flag), rspec_cmd (has_format_flag), and go_cmd (should_skip_go_test_json) option scans using arg_tokenizer::injection_point so flags or paths appearing after -- (or after a restored leading --) are not mistaken for runner options.
  • Strip a leading "--" before dispatching match_go_tool and extracting the subcommand label in go_cmd::run_other so rtk go -- tool golangci-lint run continues to route through the compact filter and rtk go -- version records "version" rather than "--" as the subcommand label.

Closes #4920

Test Plan

  • Added unit tests in src/cmds/php/pest_cmd.rs, src/cmds/ruby/rubocop_cmd.rs, src/cmds/ruby/rspec_cmd.rs, and src/cmds/go/go_cmd.rs covering -- boundaries and leading -- tokens.
  • Verified with cargo test --lib cmds::.

@CLAassistant

CLAassistant commented Nov 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added bug Something isn't working cli parser rust labels Nov 3, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

This PR fixes option-detection logic in pest, rubocop, rspec, and go command wrappers so they stop scanning for runner flags past a -- end-of-options separator. It also strips a leading -- before dispatching go subcommands so go -- tool golangci-lint run and go -- version are handled correctly. Unit tests were added covering the -- boundary behavior for each affected command.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #4920


Analyzed automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli parser rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After #4768: pest, rspec and rubocop look for their options past a restored --, so rtk stops injecting its format

2 participants