From 8ec6274119e90c5b66093a5bc39eb7d1878aac1d Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 13 Sep 2021 01:41:56 +0200 Subject: [PATCH 1/8] Add new lints, require Rust 1.55 --- lints.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lints.rs b/lints.rs index 5179555..1e94c6e 100644 --- a/lints.rs +++ b/lints.rs @@ -1,4 +1,4 @@ -// BEGIN - Embark standard lints v0.4 +// BEGIN - Embark standard lints v0.5 for Rust 1.55+ // do not change or add/remove here, but one can add exceptions after this section // for more info see: #![deny(unsafe_code)] @@ -9,6 +9,8 @@ clippy::checked_conversions, clippy::dbg_macro, clippy::debug_assert_with_mut_call, + clippy::disallowed_method, + clippy::disallowed_type, clippy::doc_markdown, clippy::empty_enum, clippy::enum_glob_use, @@ -18,13 +20,17 @@ clippy::explicit_into_iter_loop, clippy::fallible_impl_from, clippy::filter_map_next, + clippy::flat_map_option, clippy::float_cmp_const, clippy::fn_params_excessive_bools, + clippy::from_iter_instead_of_collect, clippy::if_let_mutex, clippy::implicit_clone, clippy::imprecise_flops, clippy::inefficient_to_string, clippy::invalid_upcast_comparisons, + clippy::large_digit_groups, + clippy::large_stack_arrays, clippy::large_types_passed_by_value, clippy::let_unit_value, clippy::linkedlist, @@ -39,10 +45,12 @@ clippy::match_wildcard_for_single_variants, clippy::mem_forget, clippy::mismatched_target_os, + clippy::missing_enforced_import_renames, clippy::mut_mut, clippy::mutex_integer, clippy::needless_borrow, clippy::needless_continue, + clippy::needless_for_each, clippy::option_option, clippy::path_buf_push_overwrite, clippy::ptr_as_ptr, @@ -64,8 +72,9 @@ clippy::zero_sized_map_values, future_incompatible, nonstandard_style, - rust_2018_idioms + rust_2018_idioms, + rustdoc::missing_crate_level_docs )] -// END - Embark standard lints v0.4 +// END - Embark standard lints v0.5 for Rust 1.55+ // crate-specific exceptions: #![allow()] From cc8bbabb7efbf4ab54f7565caabf997fa52ce671 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 21 Sep 2021 22:42:36 +0200 Subject: [PATCH 2/8] Add `single_match_else` --- lints.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lints.rs b/lints.rs index 1e94c6e..9f03a4f 100644 --- a/lints.rs +++ b/lints.rs @@ -58,6 +58,7 @@ clippy::rest_pat_in_fully_bound_structs, clippy::same_functions_in_if_condition, clippy::semicolon_if_nothing_returned, + clippy::single_match_else, clippy::string_add_assign, clippy::string_add, clippy::string_lit_as_bytes, From 5e091386298d294a2891f6899050d4d7735c309f Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 21 Sep 2021 22:42:59 +0200 Subject: [PATCH 3/8] Remove `rustdoc::missing_crate_level_docs`, for now --- lints.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/lints.rs b/lints.rs index 9f03a4f..b52290b 100644 --- a/lints.rs +++ b/lints.rs @@ -74,7 +74,6 @@ future_incompatible, nonstandard_style, rust_2018_idioms, - rustdoc::missing_crate_level_docs )] // END - Embark standard lints v0.5 for Rust 1.55+ // crate-specific exceptions: From d5c6df4e9446a91bc20124644c2cadbc75e826d4 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 3 Oct 2021 12:25:24 +0200 Subject: [PATCH 4/8] Add `rc_mutex` --- lints.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lints.rs b/lints.rs index b52290b..34b831a 100644 --- a/lints.rs +++ b/lints.rs @@ -54,6 +54,7 @@ clippy::option_option, clippy::path_buf_push_overwrite, clippy::ptr_as_ptr, + clippy::rc_mutex, clippy::ref_option_ref, clippy::rest_pat_in_fully_bound_structs, clippy::same_functions_in_if_condition, From 6b2c6e59e039d8f26562b7bf1d0018a6adf8c7fd Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sat, 16 Oct 2021 12:59:07 +0200 Subject: [PATCH 5/8] Fix semicolon --- lints.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lints.rs b/lints.rs index 34b831a..ea9a06a 100644 --- a/lints.rs +++ b/lints.rs @@ -74,7 +74,7 @@ clippy::zero_sized_map_values, future_incompatible, nonstandard_style, - rust_2018_idioms, + rust_2018_idioms )] // END - Embark standard lints v0.5 for Rust 1.55+ // crate-specific exceptions: From 2aba62c758337069200cff3f43bc20cf0e44dbd9 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 17 Oct 2021 21:14:57 +0200 Subject: [PATCH 6/8] Add `match_wild_err_arm` --- lints.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lints.rs b/lints.rs index ea9a06a..9aa2f6b 100644 --- a/lints.rs +++ b/lints.rs @@ -42,6 +42,7 @@ clippy::map_unwrap_or, clippy::match_on_vec_items, clippy::match_same_arms, + clippy::match_wild_err_arm, clippy::match_wildcard_for_single_variants, clippy::mem_forget, clippy::mismatched_target_os, From 5db0ff232307cf6b456b41b7600132d3c7f4e1d1 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 18 Oct 2021 21:07:53 +0200 Subject: [PATCH 7/8] Update new lints.toml --- lints.toml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lints.toml b/lints.toml index 34ed319..b8f0e06 100644 --- a/lints.toml +++ b/lints.toml @@ -2,7 +2,7 @@ [target.'cfg(all())'] rustflags = [ - # BEGIN - Embark standard lints v0.4 + # BEGIN - Embark standard lints v0.5 # do not change or add/remove here, but one can add exceptions after this section # for more info see: "-Dunsafe_code", @@ -12,6 +12,8 @@ rustflags = [ "-Wclippy::checked_conversions", "-Wclippy::dbg_macro", "-Wclippy::debug_assert_with_mut_call", + "-Wclippy::disallowed_method", + "-Wclippy::disallowed_type", "-Wclippy::doc_markdown", "-Wclippy::empty_enum", "-Wclippy::enum_glob_use", @@ -21,13 +23,17 @@ rustflags = [ "-Wclippy::explicit_into_iter_loop", "-Wclippy::fallible_impl_from", "-Wclippy::filter_map_next", + "-Wclippy::flat_map_option", "-Wclippy::float_cmp_const", "-Wclippy::fn_params_excessive_bools", + "-Wclippy::from_iter_instead_of_collect", "-Wclippy::if_let_mutex", "-Wclippy::implicit_clone", "-Wclippy::imprecise_flops", "-Wclippy::inefficient_to_string", "-Wclippy::invalid_upcast_comparisons", + "-Wclippy::large_digit_groups", + "-Wclippy::large_stack_arrays", "-Wclippy::large_types_passed_by_value", "-Wclippy::let_unit_value", "-Wclippy::linkedlist", @@ -39,20 +45,25 @@ rustflags = [ "-Wclippy::map_unwrap_or", "-Wclippy::match_on_vec_items", "-Wclippy::match_same_arms", + "-Wclippy::match_wild_err_arm", "-Wclippy::match_wildcard_for_single_variants", "-Wclippy::mem_forget", "-Wclippy::mismatched_target_os", + "-Wclippy::missing_enforced_import_renames", "-Wclippy::mut_mut", "-Wclippy::mutex_integer", "-Wclippy::needless_borrow", "-Wclippy::needless_continue", + "-Wclippy::needless_for_each", "-Wclippy::option_option", "-Wclippy::path_buf_push_overwrite", "-Wclippy::ptr_as_ptr", + "-Wclippy::rc_mutex", "-Wclippy::ref_option_ref", "-Wclippy::rest_pat_in_fully_bound_structs", "-Wclippy::same_functions_in_if_condition", "-Wclippy::semicolon_if_nothing_returned", + "-Wclippy::single_match_else", "-Wclippy::string_add_assign", "-Wclippy::string_add", "-Wclippy::string_lit_as_bytes", @@ -68,5 +79,5 @@ rustflags = [ "-Wfuture_incompatible", "-Wnonstandard_style", "-Wrust_2018_idioms", - # END - Embark standard lints v0.4 + # END - Embark standard lints v0.5 ] From 2d7c49ec23145b0c11e2749bcf1eea1565ca68b0 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 18 Oct 2021 22:04:38 +0200 Subject: [PATCH 8/8] v0.5 -> v5 --- lints.rs | 2 +- lints.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lints.rs b/lints.rs index 9aa2f6b..7ce858f 100644 --- a/lints.rs +++ b/lints.rs @@ -1,4 +1,4 @@ -// BEGIN - Embark standard lints v0.5 for Rust 1.55+ +// BEGIN - Embark standard lints v5 for Rust 1.55+ // do not change or add/remove here, but one can add exceptions after this section // for more info see: #![deny(unsafe_code)] diff --git a/lints.toml b/lints.toml index b8f0e06..3066c87 100644 --- a/lints.toml +++ b/lints.toml @@ -2,7 +2,7 @@ [target.'cfg(all())'] rustflags = [ - # BEGIN - Embark standard lints v0.5 + # BEGIN - Embark standard lints v5 for Rust 1.55+ # do not change or add/remove here, but one can add exceptions after this section # for more info see: "-Dunsafe_code", @@ -79,5 +79,5 @@ rustflags = [ "-Wfuture_incompatible", "-Wnonstandard_style", "-Wrust_2018_idioms", - # END - Embark standard lints v0.5 + # END - Embark standard lints v5 for Rust 1.55+ ]