From 52625254b9a6dcc9b41b3e6dd57848ec30b58e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20=C3=96nen?= Date: Tue, 12 Sep 2023 01:29:13 +0300 Subject: [PATCH] chore: move clippy lints to Cargo.toml new cargo feature has became stable at nightly: --- Cargo.toml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++- src/lib.rs | 51 --------------------------------------------- 2 files changed, 60 insertions(+), 52 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3d7bc47..484e382 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,6 @@ panic = 'abort' overflow-checks = false [features] - default = ["cmd", "config_file", "database", "dotenv", "music", "spotify"] cmd = ["dep:clap", "dep:clap_complete"] config_file = ["dep:directories", "dep:taplo"] @@ -60,3 +59,63 @@ database = ["dep:directories", "dep:sqlx", "music"] dotenv = ["dep:dotenvy"] music = ["dep:songbird"] spotify = ["dep:serde", "music"] + +# Clippy lints (last check 1.70.0) +# The ones commented with forbit are waiting for clippy to ignore external crate +# macros when checking for them +[lints.clippy] +cargo = "warn" +cargo_common_metadata = "allow" # Not going tp release on crates.io +complexity = "warn" +correctness = "deny" +nursery = "warn" +pedantic = "warn" +unreadable_literal = "allow" # Only used for colors +perf = "warn" +restriction = "allow" # Enabling everything is not recomanded +allow_attributes_without_reason = "warn" # Not stable yet # force +allow_attributes = "warn" # Not stable yet # force +as_underscore = "warn" # forbid +clone_on_ref_ptr = "warn" +deref_by_slicing = "warn" +dbg_macro = "warn" # forbid +disallowed_script_idents = "warn" +empty_drop = "warn" # forbid +empty_structs_with_brackets = "warn" +exhaustive_structs = "warn" +exit = "warn" +#expect_used = "warn" +format_push_string = "warn" +fn_to_numeric_cast_any = "warn" +if_then_some_else_none = "warn" +impl_trait_in_params = "warn" # forbid +large_include_file = "warn" +large_stack_arrays = "warn" +let_underscore_must_use = "warn" +lossy_float_literal = "warn" +map_err_ignore = "warn" # forbid +min_ident_chars = "warn" # forbid +missing_docs_in_private_items = "warn" +mixed_read_write_in_expression = "warn" +multiple_inherent_impl = "warn" +mutex_atomic = "warn" +pub_without_shorthand = "warn" # forbid +rc_mutex = "warn" # forbid +redundant_type_annotations = "warn" +rest_pat_in_fully_bound_structs = "warn" +same_name_method = "warn" +self_named_module_files = "warn" +str_to_string = "warn" # forbid +string_to_string = "warn" # forbid +tests_outside_test_module = "warn" # forbid +undocumented_unsafe_blocks = "warn" # forbid +unnecessary_self_imports = "warn" +unneeded_field_pattern = "warn" +unseparated_literal_suffix = "warn" # forbid +unwrap_in_result = "warn" +#unwrap_used = "warn" +style = "warn" +suspicious = "warn" + +[lints.rustdoc] +private_intra_doc_links = "allow" diff --git a/src/lib.rs b/src/lib.rs index ac453fe..964add0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,56 +1,5 @@ //! This is the main file of the project. -// Clippy lints (last check 1.70.0) -#![warn(clippy::cargo)] -#![allow(clippy::cargo_common_metadata)] // Not going tp release on crates.io -#![warn(clippy::complexity)] -#![deny(clippy::correctness)] -#![warn(clippy::nursery)] -#![warn(clippy::pedantic)] -#![allow(clippy::unreadable_literal)] // Only used for colors -#![warn(clippy::perf)] -#![allow(clippy::restriction)] // Enabling everything is not recomanded -#![warn(clippy::allow_attributes_without_reason)] // Not stable yet // force -#![warn(clippy::allow_attributes)] // Not stable yet // force -#![warn(clippy::as_underscore)] // forbid -#![warn(clippy::clone_on_ref_ptr)] -#![warn(clippy::deref_by_slicing)] -#![warn(clippy::dbg_macro)] // forbid -#![warn(clippy::disallowed_script_idents)] -#![warn(clippy::empty_drop)] // forbid -#![warn(clippy::empty_structs_with_brackets)] -#![warn(clippy::exhaustive_structs)] -#![warn(clippy::exit)] -// #![warn(clippy::expect_used)] -#![warn(clippy::format_push_string)] -#![warn(clippy::fn_to_numeric_cast_any)] -#![warn(clippy::if_then_some_else_none)] -#![warn(clippy::impl_trait_in_params)] // forbid -#![warn(clippy::large_include_file)] -#![warn(clippy::let_underscore_must_use)] -#![warn(clippy::lossy_float_literal)] -#![warn(clippy::map_err_ignore)] // forbid -#![warn(clippy::map_err_ignore)] // forget -#![warn(clippy::missing_docs_in_private_items)] -#![warn(clippy::mixed_read_write_in_expression)] -#![warn(clippy::multiple_inherent_impl)] -#![warn(clippy::mutex_atomic)] -#![warn(clippy::rc_mutex)] // forbid -#![warn(clippy::rest_pat_in_fully_bound_structs)] -#![warn(clippy::same_name_method)] -#![warn(clippy::self_named_module_files)] -#![warn(clippy::str_to_string)] // forbid -#![warn(clippy::string_to_string)] // forbid -#![warn(clippy::tests_outside_test_module)] // forbid -#![warn(clippy::undocumented_unsafe_blocks)] // forbid -#![warn(clippy::unnecessary_self_imports)] -#![warn(clippy::unneeded_field_pattern)] -#![warn(clippy::unseparated_literal_suffix)] // forbid -#![warn(clippy::unwrap_in_result)] -//#![warn(clippy::unwrap_used)] -#![warn(clippy::style)] -#![warn(clippy::suspicious)] -#![allow(rustdoc::private_intra_doc_links)] #![feature(iter_array_chunks)] #[macro_use]