-
Notifications
You must be signed in to change notification settings - Fork 24
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
build: Do not rely on RUSTFLAGS for Clippy lint configuration #499
Conversation
|
https://github.com/NomicFoundation/edr/actions/runs/9415777943/job/25937468081?pr=499 seems spurious, retrying:
|
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.
One nice-to-have. Otherwise looks good to me.
For next time, please make sure to assign reviewers to your PR. That way people get a more obvious notification and will likely review quicker :)
Cargo.toml
Outdated
rust_2018_idioms = "warn" | ||
nonstandard_style = "warn" | ||
future_incompatible = "warn" |
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.
Nice to have: alphabetic ordering
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.
Done in 74a9014. thanks!
Since Rust 1.74 it's possible to configure lints directly in the Cargo.toml rather than relying on setting custom RUSTFLAGS: https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html#lint-configuration-through-cargo.
Setting
RUSTFLAGS
is fragile as there are some corner cases to look out for, like:build.rustflags
ortarget.<cfg>.rustflags
orSee NomicFoundation/slang#880 for what we did for Slang.
This also changes the pre-commit hook to not rely/set the flag and only runs
clippy
, rather than check + clippy, which seems wasteful in this case, ascargo clippy
already runs the underlying rustc machinery for compilation checks.