Skip to content

Commit d5bac83

Browse files
committed
Refesh list of clippy lints
1 parent 40a1be6 commit d5bac83

File tree

2 files changed

+106
-21
lines changed

2 files changed

+106
-21
lines changed

community-rust-plugin/src/main/resources/org/elegoff/l10n/rust/rules/clippy/clippylints.json

Lines changed: 105 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,20 @@
3030
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant"
3131
},
3232
{
33-
"key": "clippy::arithmetic",
34-
"name": "Checks for any kind of arithmetic operation of any type. Operators like `+`, `-`, `*` or `<<` are u",
35-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic"
33+
"key": "clippy::arithmetic_side_effects",
34+
"name": "Checks any kind of arithmetic operation of any type. Operators like `+`, `-`, `*` or `<<` are usual",
35+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects"
3636
},
3737
{
3838
"key": "clippy::as_conversions",
3939
"name": "Checks for usage of `as` conversions. Note that this lint is specialized in linting *every single*",
4040
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions"
4141
},
42+
{
43+
"key": "clippy::as_ptr_cast_mut",
44+
"name": "Checks for the result of a `&self`-taking `as_ptr` being cast to a mutable pointer",
45+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#as_ptr_cast_mut"
46+
},
4247
{
4348
"key": "clippy::as_underscore",
4449
"name": "Check for the usage of `as _` conversion using inferred type.",
@@ -109,6 +114,11 @@
109114
"name": "Checks for expressions of the form `x == true`, `x != true` and order comparisons such as `x < true`",
110115
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison"
111116
},
117+
{
118+
"key": "clippy::bool_to_int_with_if",
119+
"name": "Instead of using an if statement to convert a bool to an int, this lint suggests using a `from()` fu",
120+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if"
121+
},
112122
{
113123
"key": "clippy::borrow_as_ptr",
114124
"name": "Checks for the usage of `&expr as *const T` or `&mut expr as *mut T`, and suggest using `ptr::addr_o",
@@ -134,6 +144,11 @@
134144
"name": "Checks for use of `Box<T>` where T is a collection such as Vec anywhere in the code. Check the [Box",
135145
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#box_collection"
136146
},
147+
{
148+
"key": "clippy::box_default",
149+
"name": "checks for `Box::new(T::default())`, which is better written as `Box::<T>::default()`.",
150+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#box_default"
151+
},
137152
{
138153
"key": "clippy::boxed_local",
139154
"name": "Checks for usage of `Box<T>` where an unboxed `T` would work fine.",
@@ -189,6 +204,11 @@
189204
"name": "Checks for casts between numerical types that may be replaced by safe conversion functions.",
190205
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless"
191206
},
207+
{
208+
"key": "clippy::cast_nan_to_int",
209+
"name": "Checks for a known NaN float being cast to an integer",
210+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_nan_to_int"
211+
},
192212
{
193213
"key": "clippy::cast_possible_truncation",
194214
"name": "Checks for casts between numerical types that may truncate large values. This is expected behavior,",
@@ -224,6 +244,11 @@
224244
"name": "Checks for `as` casts between raw pointers to slices with differently sized elements.",
225245
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_different_sizes"
226246
},
247+
{
248+
"key": "clippy::cast_slice_from_raw_parts",
249+
"name": "Checks for a raw slice being cast to a slice pointer",
250+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_from_raw_parts"
251+
},
227252
{
228253
"key": "clippy::char_lit_as_u8",
229254
"name": "Checks for expressions where a character literal is cast to `u8` and suggests using a byte literal i",
@@ -299,6 +324,11 @@
299324
"name": "Finds nested `match` or `if let` expressions where the patterns may be \"collapsed\" together without",
300325
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match"
301326
},
327+
{
328+
"key": "clippy::collapsible_str_replace",
329+
"name": "Checks for consecutive calls to `str::replace` (2 or more) that can be collapsed into a single call.",
330+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace"
331+
},
302332
{
303333
"key": "clippy::comparison_chain",
304334
"name": "Checks comparison chains written with `if` that can be rewritten with `match` and `cmp`.",
@@ -409,6 +439,11 @@
409439
"name": "Checks for types that derive `PartialEq` and could implement `Eq`.",
410440
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq"
411441
},
442+
{
443+
"key": "clippy::disallowed_macros",
444+
"name": "Denies the configured macros in clippy.toml Note: Even though this lint is warn-by-default, it will",
445+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros"
446+
},
412447
{
413448
"key": "clippy::disallowed_methods",
414449
"name": "Denies the configured methods and functions in clippy.toml Note: Even though this lint is warn-by-d",
@@ -724,11 +759,6 @@
724759
"name": "Checks for iterating a map (`HashMap` or `BTreeMap`) and ignoring either the keys or values.",
725760
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map"
726761
},
727-
{
728-
"key": "clippy::for_loops_over_fallibles",
729-
"name": "Checks for `for` loops over `Option` or `Result` values.",
730-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#for_loops_over_fallibles"
731-
},
732762
{
733763
"key": "clippy::forget_copy",
734764
"name": "Checks for calls to `std::mem::forget` with a value that derives the Copy trait",
@@ -834,6 +864,11 @@
834864
"name": "Checks for missing return statements at the end of a block.",
835865
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return"
836866
},
867+
{
868+
"key": "clippy::implicit_saturating_add",
869+
"name": "Checks for implicit saturating addition.",
870+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_add"
871+
},
837872
{
838873
"key": "clippy::implicit_saturating_sub",
839874
"name": "Checks for implicit saturating subtraction.",
@@ -989,6 +1024,11 @@
9891024
"name": "Checks for the use of `.iter().count()`.",
9901025
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_count"
9911026
},
1027+
{
1028+
"key": "clippy::iter_kv_map",
1029+
"name": "Checks for iterating a map (`HashMap` or `BTreeMap`) and ignoring either the keys or values.",
1030+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map"
1031+
},
9921032
{
9931033
"key": "clippy::iter_next_loop",
9941034
"name": "Checks for loops on `x.next()`.",
@@ -1150,9 +1190,14 @@
11501190
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits"
11511191
},
11521192
{
1153-
"key": "clippy::manual_empty_string_creations",
1154-
"name": "Checks for usage of `\"\"` to create a `String`, such as `\"\".to_string()`, `\"\".to_owned()`, `String::",
1155-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_empty_string_creations"
1193+
"key": "clippy::manual_clamp",
1194+
"name": "Identifies good opportunities for a clamp function from std or core, and suggests using it.",
1195+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp"
1196+
},
1197+
{
1198+
"key": "clippy::manual_filter",
1199+
"name": "Checks for usages of `match` which could be implemented using `filter`",
1200+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter"
11561201
},
11571202
{
11581203
"key": "clippy::manual_filter_map",
@@ -1229,6 +1274,11 @@
12291274
"name": "Checks for manual implementations of `str::repeat`",
12301275
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat"
12311276
},
1277+
{
1278+
"key": "clippy::manual_string_new",
1279+
"name": "Checks for usage of `\"\"` to create a `String`, such as `\"\".to_string()`, `\"\".to_owned()`, `String::",
1280+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new"
1281+
},
12321282
{
12331283
"key": "clippy::manual_strip",
12341284
"name": "Suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing using the pattern'",
@@ -1429,6 +1479,11 @@
14291479
"name": "Check for empty spin loops",
14301480
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_spin_loop"
14311481
},
1482+
{
1483+
"key": "clippy::missing_trait_methods",
1484+
"name": "Checks if a provided method is used implicitly by a trait implementation. A usage example would be a",
1485+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_trait_methods"
1486+
},
14321487
{
14331488
"key": "clippy::mistyped_literal_suffixes",
14341489
"name": "Warns for mistyped suffix in literals",
@@ -1469,6 +1524,11 @@
14691524
"name": "Checks for getting the remainder of a division by one or minus one.",
14701525
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#modulo_one"
14711526
},
1527+
{
1528+
"key": "clippy::multi_assignments",
1529+
"name": "Checks for nested assignments.",
1530+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#multi_assignments"
1531+
},
14721532
{
14731533
"key": "clippy::multiple_crate_versions",
14741534
"name": "Checks to see if multiple versions of a crate are being used.",
@@ -1551,7 +1611,7 @@
15511611
},
15521612
{
15531613
"key": "clippy::needless_borrowed_reference",
1554-
"name": "Checks for bindings that destructure a reference and borrow the inner value with `&ref`.",
1614+
"name": "Checks for bindings that needlessly destructure a reference and borrow the inner value with `&ref`.",
15551615
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference"
15561616
},
15571617
{
@@ -1756,7 +1816,7 @@
17561816
},
17571817
{
17581818
"key": "clippy::option_if_let_else",
1759-
"name": "Lints usage of `if let Some(v) = ... { y } else { x }` which is more idiomatically done with `Option",
1819+
"name": "Lints usage of `if let Some(v) = ... { y } else { x }` and `match .. { Some(v) => y, None/_ => x }`",
17601820
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else"
17611821
},
17621822
{
@@ -1776,7 +1836,7 @@
17761836
},
17771837
{
17781838
"key": "clippy::or_fun_call",
1779-
"name": "Checks for calls to `.or(foo(..))`, `.unwrap_or(foo(..))`, etc., and suggests to use `or_else`, `unw",
1839+
"name": "Checks for calls to `.or(foo(..))`, `.unwrap_or(foo(..))`, `.or_insert(foo(..))` etc., and suggests",
17801840
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call"
17811841
},
17821842
{
@@ -1814,6 +1874,11 @@
18141874
"name": "Checks for calls of `unwrap[_err]()` that will always fail.",
18151875
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#panicking_unwrap"
18161876
},
1877+
{
1878+
"key": "clippy::partial_pub_fields",
1879+
"name": "Checks whether partial fields of a struct are public. Either make all fields of a type public, or m",
1880+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#partial_pub_fields"
1881+
},
18171882
{
18181883
"key": "clippy::partialeq_ne_impl",
18191884
"name": "Checks for manual re-implementations of `PartialEq::ne`.",
@@ -1834,11 +1899,6 @@
18341899
"name": "Checks for patterns that aren't exact representations of the types they are applied to. To satisfy",
18351900
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch"
18361901
},
1837-
{
1838-
"key": "clippy::positional_named_format_parameters",
1839-
"name": "This lint warns when a named parameter in a format string is used as a positional one.",
1840-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters"
1841-
},
18421902
{
18431903
"key": "clippy::possible_missing_comma",
18441904
"name": "Checks for possible missing comma in an array. It lints if an array element is a binary operator exp",
@@ -2034,6 +2094,11 @@
20342094
"name": "Checks for unnecessary '..' pattern binding on struct when all fields are explicitly matched.",
20352095
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#rest_pat_in_fully_bound_structs"
20362096
},
2097+
{
2098+
"key": "clippy::result_large_err",
2099+
"name": "Checks for functions that return `Result` with an unusually large `Err`-variant.",
2100+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err"
2101+
},
20372102
{
20382103
"key": "clippy::result_map_or_into_option",
20392104
"name": "Checks for usage of `_.map_or(None, Some)`.",
@@ -2141,7 +2206,7 @@
21412206
},
21422207
{
21432208
"key": "clippy::similar_names",
2144-
"name": "Checks for names that are very similar and thus confusing.",
2209+
"name": "Checks for names that are very similar and thus confusing. Note: this lint looks for similar names",
21452210
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#similar_names"
21462211
},
21472212
{
@@ -2299,6 +2364,11 @@
22992364
"name": "Checks for calls to [`splitn`] (https://doc.rust-lang.org/std/primitive.str.html#method.splitn) and",
23002365
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_splitn"
23012366
},
2367+
{
2368+
"key": "clippy::suspicious_to_owned",
2369+
"name": "Checks for the usage of `_.to_owned()`, on a `Cow<'_, _>`.",
2370+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_to_owned"
2371+
},
23022372
{
23032373
"key": "clippy::suspicious_unary_op_formatting",
23042374
"name": "Checks the formatting of a unary operator on the right hand side of a binary operator. It lints if t",
@@ -2474,6 +2544,11 @@
24742544
"name": "Checks for `set_len()` call that creates `Vec` with uninitialized elements. This is commonly caused",
24752545
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#uninit_vec"
24762546
},
2547+
{
2548+
"key": "clippy::uninlined_format_args",
2549+
"name": "Detect when a variable is not inlined in a format string, and suggests to inline it.",
2550+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args"
2551+
},
24772552
{
24782553
"key": "clippy::unit_arg",
24792554
"name": "Checks for passing a unit value as an argument to a function without using a unit literal (`()`).",
@@ -2614,11 +2689,21 @@
26142689
"name": "Checks for functions that are declared `async` but have no `.await`s inside of them.",
26152690
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unused_async"
26162691
},
2692+
{
2693+
"key": "clippy::unused_format_specs",
2694+
"name": "Detects [formatting parameters] that have no effect on the output of `format!()`, `println!()` or si",
2695+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unused_format_specs"
2696+
},
26172697
{
26182698
"key": "clippy::unused_io_amount",
26192699
"name": "Checks for unused written/read amount.",
26202700
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount"
26212701
},
2702+
{
2703+
"key": "clippy::unused_peekable",
2704+
"name": "Checks for the creation of a `peekable` iterator that is never `.peek()`ed",
2705+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unused_peekable"
2706+
},
26222707
{
26232708
"key": "clippy::unused_rounding",
26242709
"name": "Detects cases where a whole-number literal float is being rounded, using the `floor`, `ceil`, or `r",

community-rust-plugin/src/test/java/org/elegoff/plugins/communityrust/clippy/ClippyRulesDefinitionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void clippyExternalRepository() {
3939
assertThat(repository.name()).isEqualTo("Clippy");
4040
assertThat(repository.language()).isEqualTo("rust");
4141
assertThat(repository.isExternal()).isTrue();
42-
assertThat(repository.rules()).hasSize(565);
42+
assertThat(repository.rules()).hasSize(582);
4343

4444
RulesDefinition.Rule rule = repository.rule("clippy::absurd_extreme_comparisons");
4545
assertThat(rule).isNotNull();

0 commit comments

Comments
 (0)