rtk-ai / rtk-ai/rtk

cargo clippy: -- separator not preserved when cargo flags are present

Open
#660 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli bug effort-small filter-quality good first issue platform:macos priority:medium
Dominant language
Rust
Stars
81.1k
Forks
5.1k
Avg merge
4d 21h
Merged PRs (30d)
35

Description

Summary

rtk cargo clippy drops or mishandles the -- separator when any cargo flag is passed before it. Arguments intended for clippy lints (e.g., -D warnings) are instead passed as filenames to rustc, causing compilation errors.

Reproduction

# Create a minimal project
cargo init /tmp/rtk-repro && cd /tmp/rtk-repro

# Works: no flags before --
rtk cargo clippy -- -D warnings
# ✓ cargo clippy: No issues found

# Fails: any flag before -- breaks it
rtk cargo clippy --all-targets -- -D warnings
# error: multiple input filenames provided (first two filenames are `src/main.rs` and `-D`)

# Direct cargo works fine with the same flags
cargo clippy --all-targets -- -D warnings
# (no errors)

Failing variations

All of these fail with the same multiple input filenames error:

rtk cargo clippy --all-targets -- -D warnings
rtk cargo clippy --workspace -- -D warnings
rtk cargo clippy -p repro -- -D warnings
rtk cargo clippy --all-targets --all-features -- -D warnings -A clippy::needless_update

Passing variation

Only the bare form (no cargo flags before --) works:

rtk cargo clippy -- -D warnings    # OK

Expected behavior

rtk cargo clippy <cargo-flags> -- <clippy-flags> should behave identically to cargo clippy <cargo-flags> -- <clippy-flags>. The -- separator and everything after it should be passed through to clippy unchanged.

Environment

  • rtk 0.30.0
  • macOS (Darwin 25.3.0, aarch64)
  • rustc 1.94.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the rtk cargo clippy command and reproduce the failure with cargo flags before the -- separator, such as --all-targets -- -D warnings. Compare its argument forwarding with direct cargo clippy; done means the separator and all following clippy flags are preserved unchanged for every listed variation.

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
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.