rtk-ai/rtk

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

Open

#660 ouverte le 17 mars 2026

Voir sur GitHub
 (6 commentaires) (0 réactions) (0 assignés)Rust (2 914 forks)batch import
area:clibugeffort-smallfilter-qualitygood first issueplatform:macospriority:medium

Métriques du dépôt

Stars
 (48 085 stars)
Métriques de merge PR
 (Merge moyen 11j 1h) (45 PRs mergées en 30 j)

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

Guide contributeur