rust-lang / rust-lang/rust-clippy
clippy --fix now errors on untracked files
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Summary
After upgrading to rust 1.67.0 clippy --fix now fails if you have any untracked files in your git repository. I now have to pass the --allow-dirty flag to use clippy --fix. I didn't have to do this in rust 1.66.0.
If this is a deliberate change, I suggest adding an --allow-untracked flag to clippy --fix so that we can get the old behavior back.
Reproducer
reproduce:
cargo new foo
cd foo
git add .
git commit -m "Initial commit"
touch bar.txt
cargo clippy --fix
I expected to see this happen: Success
Instead, this happened:
error: the working directory of this package has uncommitted changes, and `cargo fix` can potentially perform destructive changes; if you'd like to suppress this error pass `--allow-dirty`, `--allow-staged`, or commit the changes to these files:
* bar.txt (dirty)
Version
rustc 1.67.0 (fc594f156 2023-01-24)
binary: rustc
commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
commit-date: 2023-01-24
host: x86_64-unknown-linux-gnu
release: 1.67.0
LLVM version: 15.0.6
Additional Labels
No response
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 running the reported cargo new, git commit, touch bar.txt, and cargo clippy --fix reproducer with Rust 1.67.0, then inspect the clippy --fix handling related to dirty and untracked files. Confirm the behavior against Rust 1.66.0 and define done as restoring the expected success or providing the requested way to allow untracked files without allowing other dirty changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100