-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
Run clippy in the CI with warnings disallowed; address most warnings #1412
Conversation
6ca97fc
to
f077c8e
Compare
07b83e6
to
2d3236c
Compare
Looks like That raises the question: is it desired to run So for now this PR will only run |
Running on nightly doesn't make much sense, except if the target requires nightly for whatever reason. Just stable is enough, I guess. |
Doing that now, and all checks succeed 🎉 - what's your thought about getting the other PRs and this one in? |
11f0fd9
to
9a62def
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.
Actually, could you add into lib.rs of each crate.
#![deny(clippy::all)
#![cfg_attr(feature = "cargo-clippy", deny(warnings))]
Instead of denying on CI?
@kchibisov What would be the advantage of those annotations? I personally don't like disallowing all clippy warnings during development, it doesn't allow contributors to compile code when perhaps having one or two testing variables / functions commented out. Secondly, what's the advantage of disallowing normal |
I mean that with those two you can compile normally, but when you run clippy everything errors out. The intention is to error out on clippy, while allowing checks/builds to throw warnings as usual.
That's what we're using in alacritty for years. Basically it means: "when running clippy, treat all rustc warnings as errors". |
Right, yes. I use Strangely enough it seems to be fine now, without those commits 🤷
Ack, understood. I have previously seen but forgot that Do you mind if I leave
Do you mind if I leave this? In the hypothetical case that a new crate is added? Otherwise this should also be added to every binary (test/example) target. I think that's the downside of this approach: having to add it to every target and not forgetting it on new targets. IMHO it's fine for users to push and open a PR, and address remaining lints after the fact. They usually won't (be able to) test/lint against every target / feature combination anyway. If they run |
That's fine. You can go ahead. |
@kchibisov I think I did that in the last push, would you mind re-reviewing this now? What's your suggestion on the |
@MarijnS95 sharing is also failing for me. It could be failing that way for a long time on Wayland, and I won't be surprised. Not sure that we should bother with it here since it's not something new. |
@kchibisov Perfect, let's go for it then. If you can review this once more and approve it, I'll fix the conflict and re-push! |
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.
Just a small nits I've found after re-review.
Nice catch, I hadn't spotted that one in the automatic |
Depends on #1413 + #1408.
This is a draft mainly to look at how
cargo clippy --fix
and myself have addressed warnings for most issues. There are still a few remaining, and clippy found some odd/fishy things we should look into.sharing
example (doesn't run at all, but has nontrivialclippy
warnings);cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to users