-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Clippy seems a bit angry #78814
Comments
This is intentional -- clippy lints are not generally allow'd in compiler crates that we don't intend to fix, as there's many false positives in the general case. We do not check that clippy passes in CI either. IMO, it's a losing battle to try and get everything clippy complains about patched in rustc at this time, and many of the lints I at least disagree with so I don't think we would necessarily want to patch them either. I think the right path forward here is to focus on upstreaming clippy lints into rustc proper (see #53224 (comment) for the current policy on that), and then fixing as those land. FWIW PRs fixing clippy lints are generally accepted, or at least not rejected unilaterally. |
One solution is to activate only one clippy lint at a time (and do not activate the ones that aren't good) and submit patch for each lint separately. This should simplify the review. |
I've been looking at the clippy output when run on the rustc codebase here and there and I by now my number of disabled lints is at around 70 :P |
I am looking to work on the |
I added |
…=lcnr `unwrap_or` lint corrected rust-lang#78814 (comment) This pull request fixes the lint from clippy where `unwrap_or` could be better done as a `unwrap_or_else` or a `unwrap_or_default`.
My two cents: In the past we landed clippy-fix PRs that IMO didn't really help or even reduced readability, such as replacing For issues that go beyond style, such as |
Results from It looks like either
Most of the warnings come from core and are about panicking in constants. |
We don't generally strive to keep the repository clippy-clean, so I wouldn't say this is a bug. Specific PRs are sometimes accepted, but generally our policy has not been to blanket accept, since some of clippy's lints have false positives. |
Some of the very noisy clippy lints [1] have been turned off inside the repo, so that might also be change that you see in those numbers [1] |
@matthiaskrgr That is probably the most likely reason for this. @Mark-Simulacrum I will be closing this issue as it seems better to focus on voluntary "cleaning as we go" instead of a broader, more systematic approach. The warning clippy made: clippy.txt |
Running a simple
./x.py clippy
results in a roughly 49,000 line output.Are we going to try to repair all ~3,500 warnings or are some of them not helpful?
There is an argument to be made that some do have performance implications (
unwrap_or
vsunwrap_or_else
,push
vspush_str
).Other are entirely cosmetic (one letter bindings, removing
-> ()
).An initial subset of these warnings be addressed by either
@rustbot modify labels to +C-cleanup.
The text was updated successfully, but these errors were encountered: