-
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
Standard lints v7 candidates (Rust 1.60) #75
Comments
@MarijnS95 do you think these lints are a good fit for y'all also or do you have any exceptions or additions? Interested in getting feedback! |
@repi Adding them to our repo as we speak, let's see! I'll follow up shortly with a list of our own :) |
The rest is not triggering anything for us :) |
@MarijnS95 sweet, did that include testing the ones under "Considering", surprised the unsafe ones didn't trigger anything for y'all :) |
We use (and probably prefer) the other way around for now 😬
Could be interesting for us too, minus our Graphics-API crates that are really heavy on the
Yeah it is good to know the difference here. I haven't looked at the RFC discussion but this can only be about
Craving for more docs :D |
@repi I don't think we can utilize any of the opinionated extra lints, at least not across our entire project 😬 |
Now for what we've got going locally:
Most were probably already discussed in some prior PR, or disabled because they didn't seem to lint things that should have been caught. However, going further we've also been looking at default-allowed lints in rustflags = [
"-Wdeprecated-in-future",
"-Wtrivial-numeric-casts", # Included in your list above 🎉
"-Wunused-crate-dependencies",
"-Wunused-qualifications",
] More to come at some point, hopefully. Would love to enable |
Fair enough! it took us a while to adapt to it also, esp. the crate docs. None of the ones in the "Considering" are that critical for us to enable on all of our projects at this time. -- will take a look at the other ones you mention here and cross-reference with my index of tested lints and our experience with them (or if we haven't tested it yet). big thanks! |
@repi How about removing This drives developers to sometimes write If people really want no panicking code, including indexing operators that cannot be bounds-checked at compiletime, they should simply defer to |
Planning to do a larger v7 update to our standard lints (#59) with a bunch of additions and requirement of Rust 1.60
Lint candidates
These are the candidates currently thinking of and are using in our internal main repo but will experiment with all of these in our other private and open repos and see if there are any issues with them there.
Planning to add
Quite trivial but nice ones:
clippy::disallowed_script_idents
clippy::equatable_if_let
clippy::fn_to_numeric_cast_any
clippy::index_refutable_slice
clippy::iter_not_returning_iterator
clippy::negative_feature_names
clippy::nonstandard_macro_braces
clippy::trailing_empty_array
clippy::unnecessary_wraps
trivial_numeric_casts
Planning to remove
These are now warn-by-default:
clippy::disallowed_methods
clippy::disallowed_types
Considering
More opinionated for our engine repository workflow:
clippy::mod_module_files
- the style we use and preferclippy::undocumented_unsafe_blocks
- this one we do have a lot ofallow
s with for FFI crates and such, but it is a quite nice default still that we just recently activatedunsafe_op_in_unsafe_fn
- see this tracking issue and deeper discussion in RFC about the direction of getting this to be default in the language asunsafe fn
andunsafe
blocks are quite different things. Tracking Issue for "unsafe blocks in unsafe fn" (RFC #2585) rust-lang/rust#71668rustdoc::missing_crate_level_docs
- this may not be that important for many repos, but we've found it a nice quality to have for both internal and open source crates - and can just be a single-line when you add the crate.The text was updated successfully, but these errors were encountered: