Skip to content

Commit 2e80a72

Browse files
committed
refresh list of Clippy lints
1 parent 659491b commit 2e80a72

File tree

2 files changed

+102
-17
lines changed

2 files changed

+102
-17
lines changed

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

Lines changed: 101 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"name": "Checks for comparisons where one side of the relation is either the minimum or maximum value for its",
55
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons"
66
},
7+
{
8+
"key": "clippy::alloc_instead_of_core",
9+
"name": "Finds items imported through `alloc` when available through `core`.",
10+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#alloc_instead_of_core"
11+
},
712
{
813
"key": "clippy::allow_attributes_without_reason",
914
"name": "Checks for attributes that allow lints without a reason. (This requires the `lint_reasons` feature)",
@@ -24,6 +29,11 @@
2429
"name": "Checks for floating point literals that approximate constants which are defined in [`std::f32::const",
2530
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant"
2631
},
32+
{
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"
36+
},
2737
{
2838
"key": "clippy::as_conversions",
2939
"name": "Checks for usage of `as` conversions. Note that this lint is specialized in linting *every single*",
@@ -39,6 +49,11 @@
3949
"name": "Checks for `assert!(true)` and `assert!(false)` calls.",
4050
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants"
4151
},
52+
{
53+
"key": "clippy::assertions_on_result_states",
54+
"name": "Checks for `assert!(r.is_ok())` or `assert!(r.is_err())` calls.",
55+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states"
56+
},
4257
{
4358
"key": "clippy::assign_op_pattern",
4459
"name": "Checks for `a = a op b` or `a = b commutative_op a` patterns.",
@@ -74,11 +89,6 @@
7489
"name": "Checks for usage of `_.and_then(|x| Some(y))`, `_.and_then(|x| Ok(y))` or `_.or_else(|x| Err(y))`.",
7590
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map"
7691
},
77-
{
78-
"key": "clippy::blacklisted_name",
79-
"name": "Checks for usage of blacklisted names for variables, such as `foo`.",
80-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name"
81-
},
8292
{
8393
"key": "clippy::blanket_clippy_restriction_lints",
8494
"name": "Checks for `warn`/`deny`/`forbid` attributes targeting the whole clippy::restriction category.",
@@ -404,6 +414,11 @@
404414
"name": "Denies the configured methods and functions in clippy.toml Note: Even though this lint is warn-by-d",
405415
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods"
406416
},
417+
{
418+
"key": "clippy::disallowed_names",
419+
"name": "Checks for usage of disallowed names for variables, such as `foo`.",
420+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names"
421+
},
407422
{
408423
"key": "clippy::disallowed_script_idents",
409424
"name": "Checks for usage of unicode scripts other than those explicitly allowed by the lint config. This li",
@@ -571,14 +586,19 @@
571586
},
572587
{
573588
"key": "clippy::expect_used",
574-
"name": "Checks for `.expect()` calls on `Option`s and `Result`s.",
589+
"name": "Checks for `.expect()` or `.expect_err()` calls on `Result`s and `.expect()` call on `Option`s.",
575590
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#expect_used"
576591
},
577592
{
578593
"key": "clippy::expl_impl_clone_on_copy",
579594
"name": "Checks for explicit `Clone` implementations for `Copy` types.",
580595
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#expl_impl_clone_on_copy"
581596
},
597+
{
598+
"key": "clippy::explicit_auto_deref",
599+
"name": "Checks for dereferencing expressions which would be covered by auto-deref.",
600+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref"
601+
},
582602
{
583603
"key": "clippy::explicit_counter_loop",
584604
"name": "Checks `for` loops over slices with an explicit counter and suggests the use of `.enumerate()`.",
@@ -791,7 +811,7 @@
791811
},
792812
{
793813
"key": "clippy::if_then_some_else_none",
794-
"name": "Checks for if-else that could be written to `bool::then`.",
814+
"name": "Checks for if-else that could be written using either `bool::then` or `bool::then_some`.",
795815
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none"
796816
},
797817
{
@@ -939,14 +959,19 @@
939959
"name": "Checks for comparisons where the relation is always either true or false, but where one side has bee",
940960
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#invalid_upcast_comparisons"
941961
},
962+
{
963+
"key": "clippy::invalid_utf8_in_unchecked",
964+
"name": "Checks for `std::str::from_utf8_unchecked` with an invalid UTF-8 literal",
965+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#invalid_utf8_in_unchecked"
966+
},
942967
{
943968
"key": "clippy::invisible_characters",
944969
"name": "Checks for invisible Unicode characters in the code.",
945970
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters"
946971
},
947972
{
948973
"key": "clippy::is_digit_ascii_radix",
949-
"name": "Finds usages of [`char::is_digit`] (https://doc.rust-lang.org/stable/std/primitive.char.html#method.",
974+
"name": "Finds usages of [`char::is_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.i",
950975
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix"
951976
},
952977
{
@@ -989,6 +1014,16 @@
9891014
"name": "Checks for the use of `iter.nth(0)`.",
9901015
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero"
9911016
},
1017+
{
1018+
"key": "clippy::iter_on_empty_collections",
1019+
"name": "Checks for calls to `iter`, `iter_mut` or `into_iter` on empty collections",
1020+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_on_empty_collections"
1021+
},
1022+
{
1023+
"key": "clippy::iter_on_single_items",
1024+
"name": "Checks for calls to `iter`, `iter_mut` or `into_iter` on collections containing a single item",
1025+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_on_single_items"
1026+
},
9921027
{
9931028
"key": "clippy::iter_overeager_cloned",
9941029
"name": "Checks for usage of `_.cloned().<func>()` where call to `.cloned()` can be postponed.",
@@ -1084,11 +1119,6 @@
10841119
"name": "Checks for usage of any `LinkedList`, suggesting to use a `Vec` or a `VecDeque` (formerly called `Ri",
10851120
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist"
10861121
},
1087-
{
1088-
"key": "clippy::logic_bug",
1089-
"name": "Checks for boolean expressions that contain terminals that can be eliminated.",
1090-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug"
1091-
},
10921122
{
10931123
"key": "clippy::lossy_float_literal",
10941124
"name": "Checks for whole number float literals that cannot be represented as the underlying type without los",
@@ -1119,11 +1149,21 @@
11191149
"name": "Checks for uses of `std::mem::size_of::<T>() * 8` when `T::BITS` is available.",
11201150
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits"
11211151
},
1152+
{
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"
1156+
},
11221157
{
11231158
"key": "clippy::manual_filter_map",
11241159
"name": "Checks for usage of `_.filter(_).map(_)` that can be written more simply as `filter_map(_)`.",
11251160
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map"
11261161
},
1162+
{
1163+
"key": "clippy::manual_find",
1164+
"name": "Check for manual implementations of Iterator::find",
1165+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_find"
1166+
},
11271167
{
11281168
"key": "clippy::manual_find_map",
11291169
"name": "Checks for usage of `_.find(_).map(_)` that can be written more simply as `find_map(_)`.",
@@ -1134,6 +1174,11 @@
11341174
"name": "Check for unnecessary `if let` usage in a for loop where only the `Some` or `Ok` variant of the iter",
11351175
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten"
11361176
},
1177+
{
1178+
"key": "clippy::manual_instant_elapsed",
1179+
"name": "Lints subtraction between `Instant::now()` and another `Instant`.",
1180+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_instant_elapsed"
1181+
},
11371182
{
11381183
"key": "clippy::manual_map",
11391184
"name": "Checks for usages of `match` which could be implemented using `map`",
@@ -1159,6 +1204,16 @@
11591204
"name": "Checks for expressions like `x >= 3 && x < 8` that could be more readably expressed as `(3..8).conta",
11601205
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains"
11611206
},
1207+
{
1208+
"key": "clippy::manual_rem_euclid",
1209+
"name": "Checks for an expression like `((x % 4) + 4) % 4` which is a common manual reimplementation of `x.re",
1210+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_rem_euclid"
1211+
},
1212+
{
1213+
"key": "clippy::manual_retain",
1214+
"name": "Checks for code to be replaced by `.retain()`.",
1215+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain"
1216+
},
11621217
{
11631218
"key": "clippy::manual_saturating_arithmetic",
11641219
"name": "Checks for `.checked_add/sub(x).unwrap_or(MAX/MIN)`.",
@@ -1541,7 +1596,7 @@
15411596
},
15421597
{
15431598
"key": "clippy::needless_option_take",
1544-
"name": "bad?",
1599+
"name": "Checks for calling `take` function after `as_ref`.",
15451600
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_take"
15461601
},
15471602
{
@@ -1659,6 +1714,11 @@
16591714
"name": "Checks for public functions that dereference raw pointer arguments but are not marked `unsafe`.",
16601715
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref"
16611716
},
1717+
{
1718+
"key": "clippy::obfuscated_if_else",
1719+
"name": "Checks for usages of `.then_some(..).unwrap_or(..)`",
1720+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#obfuscated_if_else"
1721+
},
16621722
{
16631723
"key": "clippy::octal_escapes",
16641724
"name": "Checks for `\\0` escapes in string and byte literals that look like octal character escapes in C.",
@@ -1734,6 +1794,11 @@
17341794
"name": "Detects classic underflow/overflow checks.",
17351795
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#overflow_check_conditional"
17361796
},
1797+
{
1798+
"key": "clippy::overly_complex_bool_expr",
1799+
"name": "Checks for boolean expressions that contain terminals that can be eliminated.",
1800+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#overly_complex_bool_expr"
1801+
},
17371802
{
17381803
"key": "clippy::panic",
17391804
"name": "Checks for usage of `panic!`.",
@@ -1754,6 +1819,11 @@
17541819
"name": "Checks for manual re-implementations of `PartialEq::ne`.",
17551820
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl"
17561821
},
1822+
{
1823+
"key": "clippy::partialeq_to_none",
1824+
"name": "Checks for binary comparisons to a literal `Option::None`.",
1825+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none"
1826+
},
17571827
{
17581828
"key": "clippy::path_buf_push_overwrite",
17591829
"name": "* Checks for [push](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.push) calls on `Pa",
@@ -1764,6 +1834,11 @@
17641834
"name": "Checks for patterns that aren't exact representations of the types they are applied to. To satisfy",
17651835
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch"
17661836
},
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+
},
17671842
{
17681843
"key": "clippy::possible_missing_comma",
17691844
"name": "Checks for possible missing comma in an array. It lints if an array element is a binary operator exp",
@@ -2124,6 +2199,16 @@
21242199
"name": "When sorting primitive values (integers, bools, chars, as well as arrays, slices, and tuples of such",
21252200
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#stable_sort_primitive"
21262201
},
2202+
{
2203+
"key": "clippy::std_instead_of_alloc",
2204+
"name": "Finds items imported through `std` when available through `alloc`.",
2205+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc"
2206+
},
2207+
{
2208+
"key": "clippy::std_instead_of_core",
2209+
"name": "Finds items imported through `std` when available through `core`.",
2210+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core"
2211+
},
21272212
{
21282213
"key": "clippy::str_to_string",
21292214
"name": "This lint checks for `.to_string()` method calls on values of type `&str`.",
@@ -2566,7 +2651,7 @@
25662651
},
25672652
{
25682653
"key": "clippy::unwrap_used",
2569-
"name": "Checks for `.unwrap()` calls on `Option`s and on `Result`s.",
2654+
"name": "Checks for `.unwrap()` or `.unwrap_err()` calls on `Result`s and `.unwrap()` call on `Option`s.",
25702655
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used"
25712656
},
25722657
{
@@ -2596,7 +2681,7 @@
25962681
},
25972682
{
25982683
"key": "clippy::useless_attribute",
2599-
"name": "Checks for `extern crate` and `use` items annotated with lint attributes. This lint permits `#[allo",
2684+
"name": "Checks for `extern crate` and `use` items annotated with lint attributes. This lint permits lint at",
26002685
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute"
26012686
},
26022687
{

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(548);
42+
assertThat(repository.rules()).hasSize(565);
4343

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

0 commit comments

Comments
 (0)