Skip to content

Commit 68408ee

Browse files
committed
refresh list of Clippy lints
1 parent ac2ca22 commit 68408ee

File tree

2 files changed

+48
-13
lines changed

2 files changed

+48
-13
lines changed

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

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
"name": "Checks for expressions of the form `x == true`, `x != true` and order comparisons such as `x < true`",
8080
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison"
8181
},
82+
{
83+
"key": "clippy::borrow_as_ptr",
84+
"name": "Checks for the usage of `&expr as *const T` or `&mut expr as *mut T`, and suggest using `ptr::addr_o",
85+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr"
86+
},
8287
{
8388
"key": "clippy::borrow_interior_mutable_const",
8489
"name": "Checks if `const` items which is interior mutable (e.g., contains a `Cell`, `Mutex`, `AtomicXxxx`, e",
@@ -321,7 +326,7 @@
321326
},
322327
{
323328
"key": "clippy::disallowed_methods",
324-
"name": "Denies the configured methods and functions in clippy.toml",
329+
"name": "Denies the configured methods and functions in clippy.toml Note: Even though this lint is warn-by-d",
325330
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods"
326331
},
327332
{
@@ -331,7 +336,7 @@
331336
},
332337
{
333338
"key": "clippy::disallowed_types",
334-
"name": "Denies the configured types in clippy.toml.",
339+
"name": "Denies the configured types in clippy.toml. Note: Even though this lint is warn-by-default, it will",
335340
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types"
336341
},
337342
{
@@ -754,6 +759,11 @@
754759
"name": "Checks for the definition of inherent methods with a signature of `to_string(&self) -> String` and i",
755760
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string_shadow_display"
756761
},
762+
{
763+
"key": "clippy::init_numbered_fields",
764+
"name": "Checks for tuple structs initialized with field syntax. It will however not lint if a base initializ",
765+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#init_numbered_fields"
766+
},
757767
{
758768
"key": "clippy::inline_always",
759769
"name": "Checks for items annotated with `#[inline(always)]`, unless the annotated function is empty or simpl",
@@ -859,6 +869,11 @@
859869
"name": "Checks for the use of `iter.nth(0)`.",
860870
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero"
861871
},
872+
{
873+
"key": "clippy::iter_overeager_cloned",
874+
"name": "Checks for usage of `_.cloned().<func>()` where call to `.cloned()` can be postponed.",
875+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned"
876+
},
862877
{
863878
"key": "clippy::iter_skip_next",
864879
"name": "Checks for use of `.skip(x).next()` on iterators.",
@@ -969,6 +984,11 @@
969984
"name": "It checks for manual implementations of `async` functions.",
970985
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn"
971986
},
987+
{
988+
"key": "clippy::manual_bits",
989+
"name": "Checks for uses of `std::mem::size_of::<T>() * 8` when `T::BITS` is available.",
990+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits"
991+
},
972992
{
973993
"key": "clippy::manual_filter_map",
974994
"name": "Checks for usage of `_.filter(_).map(_)` that can be written more simply as `filter_map(_)`.",
@@ -1354,6 +1374,11 @@
13541374
"name": "Checks for usage of `for_each` that would be more simply written as a `for` loop.",
13551375
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_for_each"
13561376
},
1377+
{
1378+
"key": "clippy::needless_late_init",
1379+
"name": "Checks for late initializations that can be replaced by a `let` statement with an initializer.",
1380+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init"
1381+
},
13571382
{
13581383
"key": "clippy::needless_lifetimes",
13591384
"name": "Checks for lifetime annotations which can be removed by relying on lifetime elision.",
@@ -1436,7 +1461,7 @@
14361461
},
14371462
{
14381463
"key": "clippy::non_ascii_literal",
1439-
"name": "Checks for non-ASCII characters in string literals.",
1464+
"name": "Checks for non-ASCII characters in string and char literals.",
14401465
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal"
14411466
},
14421467
{
@@ -1446,7 +1471,7 @@
14461471
},
14471472
{
14481473
"key": "clippy::non_send_fields_in_send_ty",
1449-
"name": "Warns about fields in struct implementing `Send` that are neither `Send` nor `Copy`.",
1474+
"name": "This lint warns about a `Send` implementation for a type that contains fields that are not safe to b",
14501475
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#non_send_fields_in_send_ty"
14511476
},
14521477
{
@@ -1601,7 +1626,7 @@
16011626
},
16021627
{
16031628
"key": "clippy::ptr_arg",
1604-
"name": "This lint checks for function arguments of type `&String` or `&Vec` unless the references are mutabl",
1629+
"name": "This lint checks for function arguments of type `&String`, `&Vec`, `&PathBuf`, and `Cow<_>`. It will",
16051630
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg"
16061631
},
16071632
{
@@ -1719,11 +1744,6 @@
17191744
"name": "Checks for `ref` bindings which create a reference to a reference.",
17201745
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#ref_binding_to_reference"
17211746
},
1722-
{
1723-
"key": "clippy::ref_in_deref",
1724-
"name": "Checks for references in expressions that use auto dereference.",
1725-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#ref_in_deref"
1726-
},
17271747
{
17281748
"key": "clippy::ref_option_ref",
17291749
"name": "Checks for usage of `&Option<&T>`.",
@@ -1754,6 +1774,11 @@
17541774
"name": "Checks for public functions that return a `Result` with an `Err` type of `()`. It suggests using a c",
17551775
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err"
17561776
},
1777+
{
1778+
"key": "clippy::return_self_not_must_use",
1779+
"name": "This lint warns when a method returning `Self` doesn't have the `#[must_use]` attribute.",
1780+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use"
1781+
},
17571782
{
17581783
"key": "clippy::reversed_empty_ranges",
17591784
"name": "Checks for range expressions `x..y` where both `x` and `y` are constant and `x` is greater or equal",
@@ -1771,7 +1796,7 @@
17711796
},
17721797
{
17731798
"key": "clippy::same_name_method",
1774-
"name": "It lints if a struct has two method with same time: one from a trait, another not from trait.",
1799+
"name": "It lints if a struct has two methods with the same name: one from a trait, another not from trait.",
17751800
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#same_name_method"
17761801
},
17771802
{
@@ -1844,6 +1869,11 @@
18441869
"name": "Warns when using `push_str`/`insert_str` with a single-character string literal where `push`/`insert",
18451870
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str"
18461871
},
1872+
{
1873+
"key": "clippy::single_char_lifetime_names",
1874+
"name": "Checks for lifetimes with names which are one character long.",
1875+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#single_char_lifetime_names"
1876+
},
18471877
{
18481878
"key": "clippy::single_char_pattern",
18491879
"name": "Checks for string methods that receive a single-character `str` as an argument, e.g., `_.split(\"x\")`",
@@ -2116,7 +2146,7 @@
21162146
},
21172147
{
21182148
"key": "clippy::undocumented_unsafe_blocks",
2119-
"name": "Checks for `unsafe` blocks without a `// Safety: ` comment explaining why the unsafe operations perf",
2149+
"name": "Checks for `unsafe` blocks without a `// SAFETY: ` comment explaining why the unsafe operations perf",
21202150
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks"
21212151
},
21222152
{
@@ -2204,6 +2234,11 @@
22042234
"name": "Detects uses of `Vec::sort_by` passing in a closure which compares the two arguments, either directl",
22052235
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by"
22062236
},
2237+
{
2238+
"key": "clippy::unnecessary_to_owned",
2239+
"name": "Checks for unnecessary calls to [`ToOwned::to_owned`](https://doc.rust-lang.org/std/borrow/trait.ToO",
2240+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned"
2241+
},
22072242
{
22082243
"key": "clippy::unnecessary_unwrap",
22092244
"name": "Checks for calls of `unwrap[_err]()` that cannot fail.",

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().size()).isEqualTo(494);
42+
assertThat(repository.rules().size()).isEqualTo(501);
4343

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

0 commit comments

Comments
 (0)