rustfix
rustfix copied to clipboard
Add a `--clippy` option
Right now, there are two main interfaces for running fixes:
- `cargo fix [--tests|--benches|--lib]
-
cargo clippy --fix
It's weird that they are so different - I would expect this to be a cargo fix --clippy
option. Would it be possible for rustfix to add support so we can unify the interface?
cc @rust-lang/clippy
Aren't those flags completely handled by cargo?
I seem to remember that we had this discussion before in the cargo repo. I think it was in the context of making the clippy subcommand a first class citizen of cargo
instead of having it as an external tool that adds this subcommand (which was rejected back then, because Clippy doesn't have to be installed). Having Clippy as a first class citizen would have had the advantage that cargo could also handle things like cargo fix --clippy
. But since Clippy has to register itself as a subcommand, we also had to implement the --fix
flag on our own.
This is the PR were this discussion took place: https://github.com/rust-lang/cargo/pull/7382 (warning: it's really long!)
And here is the PR that tried adding cargo fix --clippy
: https://github.com/rust-lang/cargo/pull/7383
Thanks for the link! Yes, that would be a cargo change. I commented on the PR :)