Cargo `+toolchain` commands are not rewritten or filtered
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 81.1k
- Forks
- 5.1k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 40
Description
Bug
Cargo commands using rustup's +toolchain syntax are not recognized by the current rewrite path. Support for these commands was previously added in #99, including cargo +nightly test, but the behavior is not present in RTK 0.44.2.
Steps to reproduce
Tested with RTK 0.44.2 on macOS:
$ rtk rewrite "cargo +stable check"
$ echo $?
1
$ rtk hook check "cargo +stable check"
No rewrite for: cargo +stable check
In a crate containing a compilation error, compare:
rtk cargo check
rtk cargo +stable check
Actual behavior
rtk cargo check applies the Cargo filter and produces compact output:
cargo check: 1 errors, 0 warnings (1 crates)
rtk cargo +stable check executes the command but produces unfiltered Cargo output.
Expected behavior
rtk rewrite should recognize Cargo commands with a +toolchain selector, preserve the selector, and route the Cargo subcommand through the same output filter used without a selector.
This affects filtered subcommands such as build, check, clippy, and test.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with rtk rewrite "cargo +stable check" and rtk hook check "cargo +stable check", then trace the Cargo command rewrite path. Verify that selectors such as +stable and +nightly are preserved and that filtered subcommands including build, check, clippy, and test produce the same compact output as commands without a selector.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100