-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo clippy --explain <lintname> #8291
Comments
I've added the nominated tag to discuss this in the next meeting. Having this sounds like a good idea 🙃 |
I wonder how to best store the collected data. To start, I'm going to build a macro that will move the doc comment to a string argument. |
Sounds like a good idea, the Metadata collector for our lint list collects the docs from the doc comment. If you change the macro it would be good to reapply the doc comments to the lint item. Storage will be an interesting problem, I've looked into some ideas while I was working on #8211 but haven't found a nice solution yet. I thought about building a wrapper type about rustc's lint to store some additional Clippy data, but that didn't feel quite right to only implement nightly lints. I'm interested to see what you come up with 🙃 |
Description
Rustc has this nice
rustc --explain E060
feature.I wonder if we could have the same in form of
cargo clippy --explain needless_borrow
for example.This would print the lints explanation of the doc-comment ( https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow ) into the terminal, the advantage being that we don't need a web browser and internet to access the lint explanation 🙂
The text was updated successfully, but these errors were encountered: