cargo install clippy
Today, I am happy to announce that you can just copy the title of this blog
post to your command line and provided you have a nightly rust, you’ll be able
cargo clippy. The former
cargo-clippy project is thereby superceded.
For those who want to see the works, here’s the PR by the unstoppable oli-obk.
Since my last announcement we have added a good number of lints, and even removed four because specialization made them obsolete. We are now at 147 lints (and counting the open PRs, we’ll reach 150 soon).
Also I started the metacollect crate
(which unfortunately isn’t progressing as fast as I’d liked) that will
hopefully enable us to get more information across crates boundaries. In the
rustc has grown its own output (that DXR uses) we may be able to
use to implement more lints.
We have added some format-based lints (
suspicious_else_formatting), and the first lint to check rustdoc
Not only have we added more lints, our existing lints have improved. We’ve reduced the number of false positives, made the reporting more consistent and improved a number of suggestions.
The recent update of Rust’s error reporting output will also introduce some
changes in clippy (probably for the better), which will come during the next
RUST_NEW_ERROR_FORMAT=true on the command line to try it.
So I hope that clippy has been useful to you, and would like to hear from you. In the spirit of the recent trend to survey people for their opinion, here’s a survey about how you use clippy, and what you like or dislike.