rtk-ai/rtk

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

Open

#660 opened on 2026年3月17日

GitHub で見る
 (6 comments) (0 reactions) (0 assignees)Rust (48,085 stars) (2,914 forks)batch import
bugeffort-smallfilter-qualitygood first issue

説明

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

コントリビューターガイド