-
Notifications
You must be signed in to change notification settings - Fork 12
Propose stable clippy lint group instead of unstable. #20
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
Propose stable clippy lint group instead of unstable. #20
Conversation
|
@ralfbiedert I think this is a reasonable change. I'm surprised that the suspicious group wasn't in there in the first place, and not including unstable checks is probably a good idea for general guidelines (even if we chose to leave those on in our repos) |
|
Thanks for the PR. The suspicious group was an oversight, and we should enable it. The nursery ones have in my observation been mostly helpful (e.g., we sometimes have to disable The issue I'd have with
is that I'd still want to enable all of them, and only disable the ones that in a particular code base really get in the way. How about we suggest something like this (wording TBD): |
|
@ralfbiedert I was thinking that using the nursery group is similar to using or depending on nightly compiler builds. It's stuff that's not fully tested, not fully agreed it's the right lint to enforce, still have some false positives, etc. |
|
seems like the overall Rust nursery is about Rust experimentation: |
Yes, but I think the resulting "mechanism of action" is different: I'd argue we don't use the nightly Rust compiler because 1) it would force all our customers to nightly, 2) we don't want to rely on features that will never come, and 3) it's tested less. Most of the premises (e.g., not fully tested or agreed) are true for clippy lints, but: 1) 'nursery' use is not observable by customers, 2) if a lint is removed it will not affect the resulting code, and 3) if a lint has has issues, it can be disabled on various levels. Nursery might change in scope, but the same is true for all categories. What passes today on Going through the list of nursery lints, there are quite a few I remember having fired once we enabled them (e.g., All that said, I'm ok with us not enabling the / a category because it has been marked as 'not recommended yet' upstream (and admittedly some lints, like But I'd still want it to be mentioned (commented out or so), because lint groups are easy to forget (we forgot cargo = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
correctness = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
style = { level = "warn", priority = -1 }
suspicious = { level = "warn", priority = -1 }
# nursery = { level = "warn", priority = -1 } # optional, might cause more false positives |
Mark nursery as optional.
From the clippy lint docs (https://doc.rust-lang.org/clippy/lints.html#nursery):
I propose to include suspicious lint group instead (https://doc.rust-lang.org/clippy/lints.html#suspicious):