-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement better help for clippy-driver #4175
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
Conversation
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.
LGTM
cc @Manishearth since you opened the corresponding issue.
src/driver.rs
Outdated
print_lints(&lints); | ||
|
||
let max_name_len = std::cmp::max( | ||
"warnings".len(), |
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.
is there a clippy::warnings
group?
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.
No, there's only clippy::all
which is all warn-by-default and deny-by-default lints. You can find all available lint groups in the README:
- clippy::all
- clippy::correctness (deny-by-default)
- clippy::style (warn)
- clippy::complexity (warn)
- clippy::perf (warn)
- clippy::pedantic (allow)
- clippy::nursery (allow)
- clippy::cargo (allow)
There's also clippy::restriction
, which is allow-by-default and lints where it doesn't make sense to enable the whole group.
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.
okay, I bring this up because rustc has a hard coded bit for their warnings group because its otherwise not included with their other lint groups, it looks like we've got everything in our groups except all
, so I'm going to treat all like our version of warning and include it in the output the same way that rustc does.
Everything else will get included programatically.
Co-Authored-By: Philipp Krones <[email protected]>
@bors r+ |
📌 Commit 2719c1e has been approved by |
Implement better help for clippy-driver #4173
sorted_usable_lints.sort_by_key(|lint| lint.name.clone()); | ||
|
||
std::fs::write( | ||
"../src/lintlist/mod.rs", |
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.
After the fact review:
Shouldn't this also be done with the replace_region_in_file
function and then only update the content in the ALL_LINTS
array? When a PR adds a lint, this file needs to get updated like README.md
, ... If the update is done with the replace_region_in_file
function (like below), travis will fail if it's not updated. cc @phansch
☀️ Test successful - checks-travis, status-appveyor |
#4173