Skip to content

Commit 5262525

Browse files
committed
chore: move clippy lints to Cargo.toml
new cargo feature has became stable at nightly: <rust-lang/rfcs#3389 (comment)>
1 parent 29fb834 commit 5262525

File tree

2 files changed

+60
-52
lines changed

2 files changed

+60
-52
lines changed

Cargo.toml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,70 @@ panic = 'abort'
5252
overflow-checks = false
5353

5454
[features]
55-
5655
default = ["cmd", "config_file", "database", "dotenv", "music", "spotify"]
5756
cmd = ["dep:clap", "dep:clap_complete"]
5857
config_file = ["dep:directories", "dep:taplo"]
5958
database = ["dep:directories", "dep:sqlx", "music"]
6059
dotenv = ["dep:dotenvy"]
6160
music = ["dep:songbird"]
6261
spotify = ["dep:serde", "music"]
62+
63+
# Clippy lints (last check 1.70.0)
64+
# The ones commented with forbit are waiting for clippy to ignore external crate
65+
# macros when checking for them
66+
[lints.clippy]
67+
cargo = "warn"
68+
cargo_common_metadata = "allow" # Not going tp release on crates.io
69+
complexity = "warn"
70+
correctness = "deny"
71+
nursery = "warn"
72+
pedantic = "warn"
73+
unreadable_literal = "allow" # Only used for colors
74+
perf = "warn"
75+
restriction = "allow" # Enabling everything is not recomanded
76+
allow_attributes_without_reason = "warn" # Not stable yet # force
77+
allow_attributes = "warn" # Not stable yet # force
78+
as_underscore = "warn" # forbid
79+
clone_on_ref_ptr = "warn"
80+
deref_by_slicing = "warn"
81+
dbg_macro = "warn" # forbid
82+
disallowed_script_idents = "warn"
83+
empty_drop = "warn" # forbid
84+
empty_structs_with_brackets = "warn"
85+
exhaustive_structs = "warn"
86+
exit = "warn"
87+
#expect_used = "warn"
88+
format_push_string = "warn"
89+
fn_to_numeric_cast_any = "warn"
90+
if_then_some_else_none = "warn"
91+
impl_trait_in_params = "warn" # forbid
92+
large_include_file = "warn"
93+
large_stack_arrays = "warn"
94+
let_underscore_must_use = "warn"
95+
lossy_float_literal = "warn"
96+
map_err_ignore = "warn" # forbid
97+
min_ident_chars = "warn" # forbid
98+
missing_docs_in_private_items = "warn"
99+
mixed_read_write_in_expression = "warn"
100+
multiple_inherent_impl = "warn"
101+
mutex_atomic = "warn"
102+
pub_without_shorthand = "warn" # forbid
103+
rc_mutex = "warn" # forbid
104+
redundant_type_annotations = "warn"
105+
rest_pat_in_fully_bound_structs = "warn"
106+
same_name_method = "warn"
107+
self_named_module_files = "warn"
108+
str_to_string = "warn" # forbid
109+
string_to_string = "warn" # forbid
110+
tests_outside_test_module = "warn" # forbid
111+
undocumented_unsafe_blocks = "warn" # forbid
112+
unnecessary_self_imports = "warn"
113+
unneeded_field_pattern = "warn"
114+
unseparated_literal_suffix = "warn" # forbid
115+
unwrap_in_result = "warn"
116+
#unwrap_used = "warn"
117+
style = "warn"
118+
suspicious = "warn"
119+
120+
[lints.rustdoc]
121+
private_intra_doc_links = "allow"

src/lib.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,5 @@
11
//! This is the main file of the project.
22
3-
// Clippy lints (last check 1.70.0)
4-
#![warn(clippy::cargo)]
5-
#![allow(clippy::cargo_common_metadata)] // Not going tp release on crates.io
6-
#![warn(clippy::complexity)]
7-
#![deny(clippy::correctness)]
8-
#![warn(clippy::nursery)]
9-
#![warn(clippy::pedantic)]
10-
#![allow(clippy::unreadable_literal)] // Only used for colors
11-
#![warn(clippy::perf)]
12-
#![allow(clippy::restriction)] // Enabling everything is not recomanded
13-
#![warn(clippy::allow_attributes_without_reason)] // Not stable yet // force
14-
#![warn(clippy::allow_attributes)] // Not stable yet // force
15-
#![warn(clippy::as_underscore)] // forbid
16-
#![warn(clippy::clone_on_ref_ptr)]
17-
#![warn(clippy::deref_by_slicing)]
18-
#![warn(clippy::dbg_macro)] // forbid
19-
#![warn(clippy::disallowed_script_idents)]
20-
#![warn(clippy::empty_drop)] // forbid
21-
#![warn(clippy::empty_structs_with_brackets)]
22-
#![warn(clippy::exhaustive_structs)]
23-
#![warn(clippy::exit)]
24-
// #![warn(clippy::expect_used)]
25-
#![warn(clippy::format_push_string)]
26-
#![warn(clippy::fn_to_numeric_cast_any)]
27-
#![warn(clippy::if_then_some_else_none)]
28-
#![warn(clippy::impl_trait_in_params)] // forbid
29-
#![warn(clippy::large_include_file)]
30-
#![warn(clippy::let_underscore_must_use)]
31-
#![warn(clippy::lossy_float_literal)]
32-
#![warn(clippy::map_err_ignore)] // forbid
33-
#![warn(clippy::map_err_ignore)] // forget
34-
#![warn(clippy::missing_docs_in_private_items)]
35-
#![warn(clippy::mixed_read_write_in_expression)]
36-
#![warn(clippy::multiple_inherent_impl)]
37-
#![warn(clippy::mutex_atomic)]
38-
#![warn(clippy::rc_mutex)] // forbid
39-
#![warn(clippy::rest_pat_in_fully_bound_structs)]
40-
#![warn(clippy::same_name_method)]
41-
#![warn(clippy::self_named_module_files)]
42-
#![warn(clippy::str_to_string)] // forbid
43-
#![warn(clippy::string_to_string)] // forbid
44-
#![warn(clippy::tests_outside_test_module)] // forbid
45-
#![warn(clippy::undocumented_unsafe_blocks)] // forbid
46-
#![warn(clippy::unnecessary_self_imports)]
47-
#![warn(clippy::unneeded_field_pattern)]
48-
#![warn(clippy::unseparated_literal_suffix)] // forbid
49-
#![warn(clippy::unwrap_in_result)]
50-
//#![warn(clippy::unwrap_used)]
51-
#![warn(clippy::style)]
52-
#![warn(clippy::suspicious)]
53-
#![allow(rustdoc::private_intra_doc_links)]
543
#![feature(iter_array_chunks)]
554

565
#[macro_use]

0 commit comments

Comments
 (0)