Lints Survey #1644
Replies: 4 comments 3 replies
-
|
Some prior art at EmbarkStudios/rust-ecosystem#59 and EmbarkStudios/rust-ecosystem#75 |
Beta Was this translation helpful? Give feedback.
-
|
What about considering making certain allow-by-default lints, such as |
Beta Was this translation helpful? Give feedback.
-
|
Late contender. I propose for |
Beta Was this translation helpful? Give feedback.
-
|
I think it may be a good idea to move some of our lints from deny to warn and then run CI with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Lints Survey
This post is intended to collect information on which lints we globally deny or allow, and reasons for those, in order to arrive at a standardized, consistent, and fair list of denied and allowed lints for every crate.
Crates considered:
cache-inmemorygatewaygateway-queuehttphttp-ratelimitinglavalinkmentionmodelstandbyutilvalidateThis is the summation of all lints we deny and allow at the crate-level:
rustclintsfuture_incompatible,nonstandard_style,rust_2018_idioms,unusedDenied:
gatewayhttphttp-ratelimitinglavalinkmentionmodelstandbyutilvalidateExceptions:
cache_inmemory::UpdateCache::update:unused_variables(unused)gateway::shard::TlsError:dead_code,unused(unused)model::util::image_hash:dead_code,unused_mut(unused)These are lint groups. They are a useful base level for writing idiomatic and future-proof code.
missing_docsDenied:
cache-inmemorygatewayhttp-ratelimitinglavalinkmentionstandbyutilvalidateThis is a lint we strive to include on every crate, but there is a quite a bit of technical debt in
undocumented items. Even if we do not include it in a new standard list of lints, we should in the
future.
unsafe_codeDenied:
cache-inmemorygatewaygateway-queuehttphttp-ratelimitinglavalinkmentionmodelstandbyutilvaldiateExceptions:
model::id::Id::new_uncheckedWe should always deny this lint, unless we are re-implementing a
stdAPI.Denied Clippy Lints
clippy::allDenied:
gatewayhttphttp-ratelimitinglavalinkmentionmodelstandbyutilvalidateclippy::pedanticDenied:
gatewayhttphttp-ratelimitingmentionmodelutilvalidateClippy helps ensure higher quality code than just
rustclints can. These two lint groups should be denied on all crates.clippy::missing_const_for_fnDenied:
cache-inmemorygatewayhttphttp-ratelimitinglavalinkmentionmodelstandbyutilvalidateWe would like to make as many functions
constas possible, so we deny this lint, but there aremany occurrences of
allows due to false positives. I don't know quite how to proceed with this,suggestions would be appreciated.
clippy::missing_docs_in_private_itemsDenied:
http-ratelimitingstandbyvalidateAs with
missing_docs, we should strive for this.Allowed Clippy Lints
clippy::let_unit_valueAllowed:
gatewayThis lint was added due to a false positive quite a while ago, and never removed. It can now be removed.
clippy::missing_errors_docAllowed:
httpWe should remove this lint from the allowed list, because it does ensure good practices.
clippy::module_name_repetitionsAllowed:
gatewayhttphttp-ratelimitingmentionmodelvalidateWe disagree with this lint from a design standpoint.
clippy::must_use_candidateAllowed:
gatewayhttpmodelI don't know the best way to proceed with this lint. I would like to hear what people have to say. It should be considered alongside
clippy::return_self_not_must_use.clippy::semicolon_if_nothing_returnedAllowed:
gatewayhttphttp-ratelimitingmodelutilI believe we should stop allowing this lint, because it encourages better style.
clippy::unnecessary_wrapsAllowed:
httphttp-ratelimitingIn cases where this is ignored, it seems to be necessary from a design standpoint, but that can be considered.
clippy::used_underscore_bindingAllowed:
gatewaymodelAllowing this lint is useful for when
tracingis enabled.Conclusion
I believe that a decent list of lints to deny and allow to start with is as follows:
Beta Was this translation helpful? Give feedback.
All reactions