-
Notifications
You must be signed in to change notification settings - Fork 369
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
Use workspace level lints #5655
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.
Reviewed 51 of 51 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faern)
Cargo.toml
line 44 at r1 (raw file):
[workspace.lints.rust] rust_2018_idioms = "deny"
We could probably use workspace lints in test
as well.
talpid-core/src/lib.rs
line 3 at r1 (raw file):
//! The core components of the talpidaemon VPN client. #![deny(missing_docs)]
Maybe we should move these remaining lints to the (crate-level) [lints]
. If they're possible to combine with workspace = true
, that is.
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.
Reviewable status: 50 of 63 files reviewed, 1 unresolved discussion (waiting on @dlon)
Cargo.toml
line 44 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
We could probably use workspace lints in
test
as well.
Done! And "cleaned" up that code to follow the new linting rules ✨ 🧹
talpid-core/src/lib.rs
line 3 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
Maybe we should move these remaining lints to the (crate-level)
[lints]
. If they're possible to combine withworkspace = true
, that is.
Sadly not. If I add:
[lints.rust]
missing_docs = "deny"
...to talpid-core/Cargo.toml
, then I get:
error: failed to load manifest for workspace member `/build/mullvad-daemon`
Caused by:
failed to load manifest for dependency `mullvad-relay-selector`
Caused by:
failed to load manifest for dependency `talpid-core`
Caused by:
failed to parse manifest at `/build/talpid-core/Cargo.toml`
Caused by:
cannot override `workspace.lints` in `lints`, either remove the overrides or `lints.workspace = true` and manually specify the lints
You cannot both inherit lints and define your own in cargo.
9335af9
to
620ba82
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.
Reviewable status: 50 of 63 files reviewed, all discussions resolved (waiting on @dlon)
talpid-core/src/lib.rs
line 3 at r1 (raw file):
Previously, faern (Linus Färnstrand) wrote…
Sadly not. If I add:
[lints.rust] missing_docs = "deny"
...to
talpid-core/Cargo.toml
, then I get:error: failed to load manifest for workspace member `/build/mullvad-daemon` Caused by: failed to load manifest for dependency `mullvad-relay-selector` Caused by: failed to load manifest for dependency `talpid-core` Caused by: failed to parse manifest at `/build/talpid-core/Cargo.toml` Caused by: cannot override `workspace.lints` in `lints`, either remove the overrides or `lints.workspace = true` and manually specify the lints
You cannot both inherit lints and define your own in cargo.
Would of course be cool to require documentation on all public items in all crates. But I don't think that's a job for this PR if we decide to go there.
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.
Reviewed 13 of 13 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
Fixes DES-505 |
620ba82
to
d0ac040
Compare
New in Rust 1.74 is cargo managed linting and workspace level lints. Now when we have bumped our build containers to use newest Rust we can start using these.
This allows us to not explicitly specify deny lints in CI invocations of
cargo clippy
. It also allows us to not have to repeat wanted lints in every crate (#![deny(rust_2018_idioms)]
), something we naturally forgot to do in a bunch of crates already 🤷.This change is