From 7af5f1dacf4678b555c4666314074b522479b95c Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 17 Oct 2021 23:06:27 +0200 Subject: [PATCH 1/3] Add lints as `.cargo/config.toml` section --- lints.toml | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 lints.toml diff --git a/lints.toml b/lints.toml new file mode 100644 index 0000000..a2026d0 --- /dev/null +++ b/lints.toml @@ -0,0 +1,72 @@ +# add the below section to `.cargo/config.toml` + +[target.'cfg(feature = "cargo-clippy")'] +rustflags = [ + # BEGIN - Embark standard lints v0.4 + # do not change or add/remove here, but one can add exceptions after this section + # for more info see: + "-Dunsafe_code", + "-Wclippy::all", + "-Wclippy::await_holding_lock", + "-Wclippy::char_lit_as_u8", + "-Wclippy::checked_conversions", + "-Wclippy::dbg_macro", + "-Wclippy::debug_assert_with_mut_call", + "-Wclippy::doc_markdown", + "-Wclippy::empty_enum", + "-Wclippy::enum_glob_use", + "-Wclippy::exit", + "-Wclippy::expl_impl_clone_on_copy", + "-Wclippy::explicit_deref_methods", + "-Wclippy::explicit_into_iter_loop", + "-Wclippy::fallible_impl_from", + "-Wclippy::filter_map_next", + "-Wclippy::float_cmp_const", + "-Wclippy::fn_params_excessive_bools", + "-Wclippy::if_let_mutex", + "-Wclippy::implicit_clone", + "-Wclippy::imprecise_flops", + "-Wclippy::inefficient_to_string", + "-Wclippy::invalid_upcast_comparisons", + "-Wclippy::large_types_passed_by_value", + "-Wclippy::let_unit_value", + "-Wclippy::linkedlist", + "-Wclippy::lossy_float_literal", + "-Wclippy::macro_use_imports", + "-Wclippy::manual_ok_or", + "-Wclippy::map_err_ignore", + "-Wclippy::map_flatten", + "-Wclippy::map_unwrap_or", + "-Wclippy::match_on_vec_items", + "-Wclippy::match_same_arms", + "-Wclippy::match_wildcard_for_single_variants", + "-Wclippy::mem_forget", + "-Wclippy::mismatched_target_os", + "-Wclippy::mut_mut", + "-Wclippy::mutex_integer", + "-Wclippy::needless_borrow", + "-Wclippy::needless_continue", + "-Wclippy::option_option", + "-Wclippy::path_buf_push_overwrite", + "-Wclippy::ptr_as_ptr", + "-Wclippy::ref_option_ref", + "-Wclippy::rest_pat_in_fully_bound_structs", + "-Wclippy::same_functions_in_if_condition", + "-Wclippy::semicolon_if_nothing_returned", + "-Wclippy::string_add_assign", + "-Wclippy::string_add", + "-Wclippy::string_lit_as_bytes", + "-Wclippy::string_to_string", + "-Wclippy::todo", + "-Wclippy::trait_duplication_in_bounds", + "-Wclippy::unimplemented", + "-Wclippy::unnested_or_patterns", + "-Wclippy::unused_self", + "-Wclippy::useless_transmute", + "-Wclippy::verbose_file_reads", + "-Wclippy::zero_sized_map_values", + "-Wfuture_incompatible", + "-Wnonstandard_style", + "-Wrust_2018_idioms", + # END - Embark standard lints v0.4 +] \ No newline at end of file From fc18f05a7d0003ed64961682fc8e043b46ad3ffa Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 18 Oct 2021 15:56:53 +0200 Subject: [PATCH 2/3] Update lints.toml Switch to global build flag instead of cargo config flag --- lints.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lints.toml b/lints.toml index a2026d0..19c2708 100644 --- a/lints.toml +++ b/lints.toml @@ -1,6 +1,6 @@ # add the below section to `.cargo/config.toml` -[target.'cfg(feature = "cargo-clippy")'] +[build] rustflags = [ # BEGIN - Embark standard lints v0.4 # do not change or add/remove here, but one can add exceptions after this section @@ -69,4 +69,4 @@ rustflags = [ "-Wnonstandard_style", "-Wrust_2018_idioms", # END - Embark standard lints v0.4 -] \ No newline at end of file +] From f32d4e8bb486057b4486f0894944cabd3427f5c5 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 18 Oct 2021 17:07:16 +0200 Subject: [PATCH 3/3] Switch to use `[target.'cfg(all())']` instead --- lints.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lints.toml b/lints.toml index 19c2708..34ed319 100644 --- a/lints.toml +++ b/lints.toml @@ -1,6 +1,6 @@ # add the below section to `.cargo/config.toml` -[build] +[target.'cfg(all())'] rustflags = [ # BEGIN - Embark standard lints v0.4 # do not change or add/remove here, but one can add exceptions after this section