Skip to content

Commit

Permalink
chore: move clippy lints to Cargo.toml
Browse files Browse the repository at this point in the history
new cargo feature has became stable at nightly:
<rust-lang/rfcs#3389 (comment)>
  • Loading branch information
Erenoit committed Sep 11, 2023
1 parent 29fb834 commit 5262525
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 52 deletions.
61 changes: 60 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,70 @@ 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"]
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"
51 changes: 0 additions & 51 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 5262525

Please sign in to comment.