-
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
add "cargo dev crater" to run clippy on a fixed set of crates and diff the lint warnings #6469
Conversation
r? @Manishearth (rust-highfive has picked a reviewer for you, use r? to override) |
a0e0baf
to
3404e4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some ideas how to expand this.
clippy_dev/src/crater.rs
Outdated
"--message-format=short", | ||
"--", | ||
"--cap-lints=warn", | ||
"-Wclippy::pedantic", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be nice if we can specify the lint groups with a flag. I think this default is fine though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, why not just lint everything?
That way we have greater coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, by default that is good, but for future testing, we might want to only run exactly one lint, to make it easier to check the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, sorry I left several 'single comments' – it always bothers me when people do that :)
fe8f897
to
202c46c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of my enhancement suggestions should block this PR. I you feel like you don't want to add this (yet), we can merge this as is and revisit possible enhancements later when we need them.
913caa1
to
98f8c4d
Compare
590e046
to
00e36d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM now! Please squash some of the commits.
Two more ideas I got from this:
- maybe it would make sense to dump the lint statistics in the log file for a quick overview of the changes.
- Something for the future: We could implement an disabled by default lint that looks for
allow(clippy::_)
attributes and then use this tool to find out how often (and which) Clippy lints are allowed in crates that use Clippy.
This can be done in future PRs, so r=me once squashed.
Potential bikeshed: Would it maybe make sense to rename this to something else than |
☔ The latest upstream changes (presumably #6547) made this pull request unmergeable. Please resolve the merge conflicts. |
@matthiaskrgr The only thing to address for this to get merged is the request for renaming this to $something else. |
Yes, sorry, i'll try to wrap this over the course of the weekend. |
I've renamed to "lintcheck" now, hope that's better. |
7499cc8
to
253740a
Compare
…ic and cargo lints, ignore tokei for now.
Also sort lint results alphabetically.
…get the lint name of a warning
…d crates with --only crate
… in the .toml list
make serde a feature-dep save clippy version in the crater log
253740a
to
5b6a183
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phansch r=me if you're also ok with the new name.
@bors r=flip1995 |
📌 Commit 5b6a183 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
cargo dev crater
now does the following:build clippy in debug mode
for a fixed set of crates:
download and extract the crate
run compiled clippy on the crate
dump the warnings into a file that is inside the repo
We can then do a "git diff" and see what effects our clippy changes had on a tiny fraction of the rust ecosystem and can see when an change unexpectedly added or silenced a lot of warnings.
Checking all the crates took less than 5 minutes on my system.
Should help with #6429
Please write a short comment explaining your change (or "none" for internal only changes)
changelog: extend cargo dev to run clippy against a fixed set of crates and compare warnings