rust-ecosystem
rust-ecosystem copied to clipboard
Clippy wants
Wish list of Clippy lints and features & bug fixes we would like to see added/improved/fixed based on the Rust projects we've been developing at Embark.
This is not a complete list, but an attempt to keep a bit of structure for our own sake, and may be of interest for Clippy lint developers as well.
Should have
Lints & Clippy features or fixes that would directly improve or help our workflows
- [x] https://github.com/rust-lang/rust-clippy/issues/6625 (also see #22)
- [ ] https://github.com/rust-lang/cargo/issues/12208
- [x] https://github.com/rust-lang/rust-clippy/issues/8679 (Embark filed)
- [ ] https://github.com/rust-lang/rust-clippy/issues/8567 (Embark filed)
- [x] https://github.com/rust-lang/rust-clippy/issues/7005 (Embark filed)
- [x] https://github.com/rust-lang/rust-clippy/issues/3689 (
cast_lossless
) - [x] https://github.com/rust-lang/rust-clippy/issues/8505
- [ ] https://github.com/rust-lang/rust-clippy/issues/8349
- [ ] https://github.com/rust-lang/rust-clippy/issues/8246
- [x] https://github.com/rust-lang/rust-clippy/issues/7954
- [ ] https://github.com/rust-lang/rust-clippy/issues/7828
- [ ] https://github.com/rust-lang/rust-clippy/issues/7763
- [ ] https://github.com/rust-lang/rust-clippy/issues/3045
- [ ] https://github.com/rust-lang/rust-clippy/issues/8092
- [x] https://github.com/rust-lang/rust-clippy/issues/6902
- [x] https://github.com/rust-lang/rust-clippy/issues/6880
- [ ] https://github.com/rust-lang/rust-clippy/issues/5736 (by @jhpratt)
- [x] https://github.com/rust-lang/rust-clippy/issues/3122
- [ ] https://github.com/rust-lang/rust-clippy/issues/9320
- [ ] https://github.com/rust-lang/rust-clippy/issues/9063
- [x] https://github.com/rust-lang/rust-clippy/issues/10087
- [x] https://github.com/rust-lang/rust-clippy/issues/9961
- [x] https://github.com/rust-lang/rust-clippy/issues/11620
- [x] https://github.com/rust-lang/rust-clippy/issues/11649
Nice to have
Lints & Clippy features or fixes that would be nice to have, but are lower priority to us than the above list.
- [x] https://github.com/rust-lang/rust-clippy/issues/8399
- [x] https://github.com/rust-lang/rust-clippy/issues/8603
- [x] https://github.com/rust-lang/rust-clippy/issues/8368
- [x] https://github.com/rust-lang/rust-clippy/issues/8088
- [ ] https://github.com/rust-lang/rust-clippy/issues/8022
- [x] https://github.com/rust-lang/rust-clippy/issues/7959
- [x] https://github.com/rust-lang/rust-clippy/issues/7958
- [ ] https://github.com/rust-lang/rust-clippy/issues/8439
- [x] https://github.com/rust-lang/rust-clippy/issues/7714
- [x] https://github.com/rust-lang/rust-clippy/issues/7381
- [ ] https://github.com/rust-lang/rust-clippy/issues/7500
- [ ] https://github.com/rust-lang/rust-clippy/issues/7459
- [x] https://github.com/rust-lang/rust-clippy/issues/7328
- [ ] https://github.com/rust-lang/rust-clippy/issues/5974
- [x] https://github.com/rust-lang/rust-clippy/issues/5794
- [ ] https://github.com/rust-lang/rust-clippy/issues/8522 (by @jhpratt)
- [x] https://github.com/rust-lang/rust-clippy/issues/8863
Not filed / found
Fixes or enhancements that believe there is no issue for yet, if you find one please do comment and we'll update it here.
- [ ]
cargo clippy --fix
often doesn't work and it is unclear to the user which lints it works for and which it skips - [ ] A lint to require types in crate to be used fully qualified, like
log::info!("hej")
instead ofuse log::info; info!("hej")
by specifyinglog
crate inclippy.toml
section for the lint. - [ ] A lint to disallow returning
Option<()>
as we've seen that use in code just to (too) easily early out with?
on empty options.
Related tracking issues for other Rust components:
- #84
- #83
- #86
You are perhaps also interested in unused-crate-dependencies
, were the "false-positives" around multi-target crates figured out / resolved: https://github.com/rust-lang/rust/issues/95513
Seems like you're also tracking this in https://github.com/EmbarkStudios/rust-ecosystem/issues/16 though :)
this is a awsome list, thanks
@repi what are your thoughts on the new [lints]
table? https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html
I considered converting to it and submitting a PR here, but a massive downside is that the table isn't forced down on all crates from the workspace; instead every individual workspace member crate has to opt-in by setting [lints] workspace = true
.
it is unfortunate and a miss as it makes it very error prone to opt into the workspace lints (rather than opting out), we should have tested the new clippy workspace lint setting more in nightly and given feedback about that.
for our main projects we'll likely still use the new [lints]
and update every crate to use it (cc @Jake-Shadle ), and likely write some small automation script for CI to verify that it is used in all of them (or maybe fit for cargo-deny, though a bit odd to have in there).
for all of our smaller open source projects we will likely not change to use the new functionality just because of this reason, it is easier to use .cargo/config.toml
RUSTFLAGS
override and have it automatically be enabled for all crates in the project, or cargo cranky
.
hope these new lint support can be improved to be implicitly inherited from the workspace without changes in the future, this seems to be the main discussion issue for that:
- https://github.com/rust-lang/cargo/issues/12208
we should have tested the new clippy workspace lint setting more in nightly and given feedback about that.
Same for us, I've been subscribed to the relevant issues but was never able to follow up on testing this.
That said it likely won't have made a difference given the same reasons in the linked issue: this is an MVP, and implicit/forced inheritance is an addition that can be supplied in later updates.
Keep us posted if you figure out some trivial CI tooling, we might adopt that :)