Skip to content

Commit 1889c6c

Browse files
committed
Copy lint tables from rust-lang/rust-analyzer#15017
1 parent 85c9a83 commit 1889c6c

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

Cargo.toml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ dissimilar = "1.0.7"
105105
either = "1.9.0"
106106
expect-test = "1.4.0"
107107
hashbrown = { version = "0.14", features = [
108-
"inline-more",
108+
"inline-more",
109109
], default-features = false }
110110
indexmap = "2.1.0"
111111
itertools = "0.12.0"
@@ -118,9 +118,9 @@ semver = "1.0.14"
118118
serde = { version = "1.0.192", features = ["derive"] }
119119
serde_json = "1.0.108"
120120
smallvec = { version = "1.10.0", features = [
121-
"const_new",
122-
"union",
123-
"const_generics",
121+
"const_new",
122+
"union",
123+
"const_generics",
124124
] }
125125
smol_str = "0.2.1"
126126
text-size = "1.1.1"
@@ -138,8 +138,49 @@ xshell = "0.2.5"
138138
# We need to freeze the version of the crate, as the raw-api feature is considered unstable
139139
dashmap = { version = "=5.5.3", features = ["raw-api"] }
140140

141+
[workspace.lints.rust]
142+
rust_2018_idioms = "warn"
143+
unused_lifetimes = "warn"
144+
semicolon_in_expressions_from_macros = "warn"
145+
141146
[workspace.lints.clippy]
147+
# TODO: Remove the tidy test once the lint table is stable
148+
149+
# lint groups
150+
complexity = { level = "warn", priority = -1 }
151+
correctness = { level = "deny", priority = -1 }
152+
perf = { level = "deny", priority = -1 }
153+
restriction = { level = "allow", priority = -1 }
154+
style = { level = "warn", priority = -1 }
155+
suspicious = { level = "warn", priority = -1 }
156+
157+
# allow following lints
142158
collapsible_if = "allow"
143159
needless_pass_by_value = "allow"
144160
nonminimal_bool = "allow"
145161
redundant_pattern_matching = "allow"
162+
# () makes a fine error in most cases
163+
result_unit_err = "allow"
164+
# We don't expose public APIs that matter like this
165+
len_without_is_empty = "allow"
166+
# We currently prefer explicit control flow return over `...?;` statements whose result is unused
167+
question_mark = "allow"
168+
# We have macros that rely on this currently
169+
enum_variant_names = "allow"
170+
# Builder pattern disagrees
171+
new_ret_no_self = "allow"
172+
non_canonical_clone_impl = "allow"
173+
non_canonical_partial_ord_impl = "allow"
174+
format_collect = "allow"
175+
176+
# Following lints should be tackled at some point
177+
too_many_arguments = "allow"
178+
type_complexity = "allow"
179+
180+
# warn at following lints
181+
dbg_macro = "warn"
182+
todo = "warn"
183+
unimplemented = "warn"
184+
rc_buffer = "warn"
185+
# FIXME enable this, we use this pattern a lot so its annoying work ...
186+
# str_to_string = "warn"

0 commit comments

Comments
 (0)