-
Notifications
You must be signed in to change notification settings - Fork 18
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
Embark's standard lints #59
Comments
Switches to use our new standard template for defining shared Rust and Clippy lints for our Embark projects, EmbarkStudios/rust-ecosystem#59. Did a couple of lint fixes from this but didn't want to make the change too intrusive so added some allow exceptions for now that can be revisited
Switches to use our new standard template for defining shared Rust and Clippy lints for our Embark projects, EmbarkStudios/rust-ecosystem#59. Did a couple of lint fixes from this but didn't want to make the change too intrusive so added some allow exceptions for now that can be revisited
Filed EmbarkStudios/opensource#35 to start using the template in all of our current open source repos |
#60 is a PR draft and discussion about potential additions and removals for v0.3 |
We have a v0.3 of the lints now also that adds the following ones that we've verified across multiple of our codebases 🎉
|
Switches to use our new standard template for defining shared Rust and Clippy lints for our Embark projects, EmbarkStudios/rust-ecosystem#59. Did a couple of lint fixes from this but didn't want to make the change too intrusive so added some allow exceptions for now that can be revisited
We've released v0.4 with significant amount of smaller pedantic lints added, and a couple removals. Details in PR #66 |
I think we should remove |
@Jake-Shadle There was a similar Rust 1.55+ requirement for v5, seems like we can do the same for a v6 release? In any case, I fixed these in #73, we at traverse are actively using this setup. Looking at it again I'll remove them in that PR, as they're already warn-by-default and thus provide no extra benefit being configured explicit (if they weren't, |
Yes, since they are warn by default I don't think it makes sense to keep them in the list at all, technically it's a breaking change to keep them in the list due to the clippy change, but it will be fine to do that in a 0.6 version, I just wanted to post here for when that does happen because I'm in the process of removing them from all of the crates I maintain. |
Oh they are warn-by-default now, that's great and yes then we shall simply remove them. Will do a v6 release now soon requires 1.59 with them removed. And follow up with another release soon with new additional lints that we've been using and testing. |
Released v6 now with the renamed warn-by-default lints removed. (#74) |
Well, guess I am too late to update that PR 😬 Any other lints in the list that are now default-warn? With additional lints pending, shall we submit some of ours again too (after deduplicating with what Embark has been testing with)? We've been finding some interesting new flags as well. |
@MarijnS95 just wanted to get out v6 quickly to unblock Rust 1.59 clippy compile errors. created #75 to discuss v7 additions and removals and good idea also to go through and see if there are more warn-by-default lints we can remove. and great if you have any other lints that you've been testing with and that works well, so let's discuss in that! |
The config currently needs to be kept in each root module right now, which is inconvenient and error-prone. Hopefully it gets fixed soon. For a good summary see here: EmbarkStudios/rust-ecosystem#59
Enables our standard lints from EmbarkStudios/rust-ecosystem#59 and fixes up the code for it. Pretty trivial changes.
I've created an RFC for package-level lint configuration: rust-lang/rfcs#3389 |
I feel like the above RFC has shaped up quite well. As Embark has a large lint configuration that gets copied from project to project, I'm curious how well you feel the current design works out from the "large user" perspective. In particular
(I think that covered all the more controversial items) |
@repi there is one particular point the cargo team is hoping Embark can spare some time to provide feedback on regarding your experience with your lints lists. Problem: RUSTFLAGS has baked in an ordering so users can have lints override groups. We are exploring how to support this within the We are particularly concerned about the experience managing large lists of lints, not just that some experts can maintain it but with an eye of empathy towards what problems other users may have. In a recent post, I've laid out the options we are considering. "large lists of lints" came up in two parts of the conversation within the cargo team
|
Background
This issue tracks which Rust and Clippy lints we currently use as default for all of our internal and external crates. We have a common base of lints that we configure the same everywhere that is more opinionated than the Rust and Clippy defaults and geared towards how we prefer to (currently) write & maintain Rust code.
Individual crates are able to, and often do override some of these defaults, either on a crate level, or for specific modules or functions. But we still find it helpful to have a standard across everything to keep the code high quality and generally working the same way.
Lint configuration
We currently have two ways to enable our configured lints:
.cargo/config.toml
section: https://github.com/EmbarkStudios/rust-ecosystem/blob/main/lints.tomlTraditionally we've used option 1, but are testing and converting more to option 2 as it is much easier to just have a single configuration file with everything.
We hope to later in 2021 have proper first-class support for a
lints.toml
or[lints]
section in Cargo and switch to that, but progress for it has been slow. Tracked in:Lints of interests
Testing / being discussed
clippy::needless_pass_by_value
- helped us catch a lot of unnecessary: Vec<T>
arguments and replace them with: &[T]
, saving a lot of calls to.clone()
(very common trap for rust beginners to fall into). quite intrusive change for lots of crates though so safer to do separtelyrustdoc::missing_crate_level_docs
Blocked
List of Clippy lints we are interested in using, but that have issues or are not mature / specific enough yet for inclusion.
clippy::use_self
- blocked onclippy::use_self
has too many false positives #53clippy::unnecessary_wraps
clippy::option_if_let_else
- blocked on:option_if_let_else
causes a compilation errorerror[E0382]: Borrow of moved value
rust-lang/rust-clippy#6737clippy::wildcard_enum_match_arm
- blocked on wildcard_enum_match_arm fail with non-exhaustive enums and OR patterns rust-lang/rust-clippy#6862clippy::print_stdout
/clippy::print_stderr
- ineffective due to EarlyLintPass::check_mac() is not called in non-toplevel modules rust-lang/rust-clippy#5721The text was updated successfully, but these errors were encountered: