rust-lang / rust-lang/rust-clippy
Apply Clippy's `--fix` to a single file.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
I've been testing clippy --fix since #5363 got merged, and it's working great ❤️.
I've been thinking on integrating it into my editor similar to how rustfmt runs when I save a file.
Currently, clippy --fix fixes all issues in a project. Running clippy against a single file isn't useful (or supported), since it needs the context of a single crate to be able to report certain problems (e.g. unused variables, etc).
However, a combination of "check entire crate", combined with "apply fixes for this one file", would make it possible to integrate Clippy in an editor by applying fixes to the active file, while still checking the entire crate for contextual information it needs.
I'm curious if this is something that sounds interesting to pursuit. I'm not sure what the UX around this feature would be, but I guess it would be to provide --fix, and also some kind of repeatable --fix-file to fix any issues in one or more files?
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 reviewing the existing clippy --fix behavior and the discussion around issue #5363. Define how whole-crate checking should interact with applying fixes to selected files, including the proposed repeatable --fix-file option and editor workflow. Done should include an agreed command-line interface and behavior for one or more files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100