-
Notifications
You must be signed in to change notification settings - Fork 151
Cargo.toml: add workspace-level clippy config #1411
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
Adds a set of workspace-level lints including common ones we've used in
the past and others collected via running `clippy::pedantic` on several
of our crates and looking for interesting ones.
Workspace-level lints require explict opt-in from each crate's
Cargo.toml, so there's nothing forcing any crate to use them:
[lints]
workspace = true
That said, I have opted every crate in the workspace into these lints
and gotten them all to pass except for `wycheproof2blb` which is an
internal utility tool and I didn't feel like it was worth the hassle.
Even then, the lints are all set to `"warn"`, so they can be easily
overridden by `#[allow(...)]` attributes, including `#![allow(...)]`
to shut them off at the granularity of an entire crate.
I managed to fix most of the issues that `cargo clippy --fix` didn't fix
automatically including some missing documentation and documentation
formatting issues.
The main thing I didn't fix was adding missing `SAFETY` comments,
which is a problem with a few of the crates in this repo. I disabled a
lint at the crate level and added a TODO where we're missing them and it
wasn't easily corrected.
|
A couple of changes from #1399
However the changes for above are still in there and I need to go back and clean them up. Beyond that, we need a solution for Anything else? |
newpavlov
left a comment
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.
Duplicating comments from the previous PR.
|
Alright, I think that's everything except what to do about |
newpavlov
left a comment
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.
Approving on condition of minimal-versions being fixed.
Generates a stub Cargo.toml at the workspace level which configures a workspace with one member whose path is the current working directory. I think this might resolve the problem I was having with using workspace-level configs in conjunction with `minimal-versions` on RustCrypto/utils#1411 Not sure how to test it
|
Okay, getting closer... Might actually end up needing something multi-line after all, heh |
|
Looks like RustCrypto/actions#53 did the trick and |
These sorts of imperative-style loops are often one of the easiest-to-read solutions to simple problems. I thought I added this to #1411 but I guess it got lost along the way.
(NOTE: take 2, after I accidentally closed #1399)
Adds a set of workspace-level lints including common ones we've used in the past and others collected via running
clippy::pedanticon several of our crates and looking for interesting ones.Workspace-level lints require explict opt-in from each crate's Cargo.toml, so there's nothing forcing any crate to use them:
That said, I have opted every crate in the workspace into these lints and gotten them all to pass except for
wycheproof2blbwhich is an internal utility tool and I didn't feel like it was worth the hassle.Even then, the lints are all set to
"warn", so they can be easily overridden by#[allow(...)]attributes, including#![allow(...)]to shut them off at the granularity of an entire crate.I managed to fix most of the issues that
cargo clippy --fixdidn't fix automatically including some missing documentation and documentation formatting issues.The main thing I didn't fix was adding missing
SAFETYcomments, which is a problem with a few of the crates in this repo. I disabled a lint at the crate level and added a TODO where we're missing them and it wasn't easily corrected.See also: RustCrypto/meta#24