Skip to content

fix(cargo): preserve clippy -- separator with cargo flags#679

Open
TechWizard9999 wants to merge 1 commit intortk-ai:developfrom
TechWizard9999:fix/cargo-clippy-preserve-separator-with-cargo-flags
Open

fix(cargo): preserve clippy -- separator with cargo flags#679
TechWizard9999 wants to merge 1 commit intortk-ai:developfrom
TechWizard9999:fix/cargo-clippy-preserve-separator-with-cargo-flags

Conversation

@TechWizard9999
Copy link
Copy Markdown
Contributor

Description

Fixes rtk cargo clippy argument reconstruction when cargo flags are present before --.

Related Issue

Closes #660

Changes Made

  • hardened -- restoration logic to reconstruct the split point using ordered token matching (instead of broad containment counting)
  • kept idempotent behavior when Clap already preserves --
  • added regression tests for reported failing variants:
    • --all-targets -- -D warnings
    • --workspace -- -D warnings
  • updated changelog under Unreleased bug fixes

Files Changed

  • src/cargo_cmd.rs
  • CHANGELOG.md

Testing

  • cargo fmt --all --check
  • rtk cargo clippy --all-targets (2 pre-existing warnings in untouched files)
  • rtk cargo test
  • rtk cargo test cargo_cmd::tests::test_restore_double_dash_clippy_with_all_targets
  • rtk cargo test cargo_cmd::tests::test_restore_double_dash_clippy_with_workspace

cc @pszymkowiak for review

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 20, 2026

CLA assistant check
All committers have signed the CLA.

@TechWizard9999
Copy link
Copy Markdown
Contributor Author

@pszymkowiak could you please review this and let me know if anything needs to change?

@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

@TechWizard9999 TechWizard9999 force-pushed the fix/cargo-clippy-preserve-separator-with-cargo-flags branch from 80d643e to 925b44b Compare March 27, 2026 01:49
@TechWizard9999
Copy link
Copy Markdown
Contributor Author

Rebased on latest develop per the refactor notice and force-updated this branch.

@pszymkowiak could you please re-review when convenient?

@TechWizard9999 TechWizard9999 force-pushed the fix/cargo-clippy-preserve-separator-with-cargo-flags branch from 925b44b to 027023e Compare March 30, 2026 03:21
Signed-off-by: Roopesh <roopesh1724989@gmail.com>
@TechWizard9999 TechWizard9999 force-pushed the fix/cargo-clippy-preserve-separator-with-cargo-flags branch from 027023e to dc29900 Compare April 15, 2026 14:11
@TechWizard9999
Copy link
Copy Markdown
Contributor Author

Rebased on latest develop and force-pushed to refresh this PR.\n\nI also re-ran the related cargo separator test locally.\n\n@pszymkowiak @FlorianBruniaux please re-review when convenient.

@TechWizard9999
Copy link
Copy Markdown
Contributor Author

Quick maintainer ping after rebase/refresh. @pszymkowiak @FlorianBruniaux please re-review when convenient.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants