Skip to content

Commit 409ed2b

Browse files
committed
Refresh Clippy list
1 parent deb6657 commit 409ed2b

File tree

2 files changed

+113
-28
lines changed

2 files changed

+113
-28
lines changed

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

Lines changed: 94 additions & 9 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::allow_attributes_without_reason",
9+
"name": "Checks for attributes that allow lints without a reason. (This requires the `lint_reasons` feature)",
10+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason"
11+
},
712
{
813
"key": "clippy::almost_swapped",
914
"name": "Checks for `foo = bar; bar = foo` sequences.",
@@ -129,6 +134,16 @@
129134
"name": "Checks for calls to `ends_with` with possible file extensions and suggests to use a case-insensitive",
130135
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#case_sensitive_file_extension_comparisons"
131136
},
137+
{
138+
"key": "clippy::cast_enum_constructor",
139+
"name": "Checks for casts from an enum tuple constructor to an integer.",
140+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_constructor"
141+
},
142+
{
143+
"key": "clippy::cast_enum_truncation",
144+
"name": "Checks for casts from an enum type to an integral type which will definitely truncate the value.",
145+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_enum_truncation"
146+
},
132147
{
133148
"key": "clippy::cast_lossless",
134149
"name": "Checks for casts between numerical types that may be replaced by safe conversion functions.",
@@ -164,6 +179,11 @@
164179
"name": "Checks for casts from a signed to an unsigned numerical type. In this case, negative values wrap aro",
165180
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss"
166181
},
182+
{
183+
"key": "clippy::cast_slice_different_sizes",
184+
"name": "asts between raw pointers to slices with differently sized elements.",
185+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_different_sizes"
186+
},
167187
{
168188
"key": "clippy::char_lit_as_u8",
169189
"name": "Checks for expressions where a character literal is cast to `u8` and suggests using a byte literal i",
@@ -254,6 +274,11 @@
254274
"name": "Checks for types that implement `Copy` as well as `Iterator`.",
255275
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#copy_iterator"
256276
},
277+
{
278+
"key": "clippy::crate_in_macro_def",
279+
"name": "Checks for use of `crate` as opposed to `$crate` in a macro definition.",
280+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def"
281+
},
257282
{
258283
"key": "clippy::create_dir",
259284
"name": "Checks usage of `std::fs::create_dir` and suggest using `std::fs::create_dir_all` instead.",
@@ -294,6 +319,11 @@
294319
"name": "Checks for literal calls to `Default::default()`.",
295320
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access"
296321
},
322+
{
323+
"key": "clippy::default_union_representation",
324+
"name": "Displays a warning when a union is declared with the default representation (without a `#[repr(C)]`",
325+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#default_union_representation"
326+
},
297327
{
298328
"key": "clippy::deprecated_cfg_attr",
299329
"name": "Checks for `#[cfg_attr(rustfmt, rustfmt_skip)]` and suggests to replace it with `#[rustfmt::skip]`.",
@@ -309,6 +339,11 @@
309339
"name": "Checks for usage of `*&` and `*&mut` in expressions.",
310340
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof"
311341
},
342+
{
343+
"key": "clippy::deref_by_slicing",
344+
"name": "Checks for slicing expressions which are equivalent to dereferencing the value.",
345+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#deref_by_slicing"
346+
},
312347
{
313348
"key": "clippy::derivable_impls",
314349
"name": "Detects manual `std::default::Default` implementations that are identical to a derived implementatio",
@@ -409,6 +444,11 @@
409444
"name": "Checks for empty `loop` expressions.",
410445
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop"
411446
},
447+
{
448+
"key": "clippy::empty_structs_with_brackets",
449+
"name": "Finds structs without fields (a so-called \"empty struct\") that are declared with brackets.",
450+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets"
451+
},
412452
{
413453
"key": "clippy::enum_clike_unportable_variant",
414454
"name": "Checks for C-like enumerations that are `repr(isize/usize)` and have values that don't fit into an `",
@@ -879,6 +919,11 @@
879919
"name": "Checks for use of `.skip(x).next()` on iterators.",
880920
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next"
881921
},
922+
{
923+
"key": "clippy::iter_with_drain",
924+
"name": "Checks for use of `.drain(..)` on `Vec` and `VecDeque` for iteration.",
925+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_with_drain"
926+
},
882927
{
883928
"key": "clippy::iterator_step_by_zero",
884929
"name": "Checks for calling `.step_by(0)` on iterators which panics.",
@@ -1234,6 +1279,11 @@
12341279
"name": "Checks for the doc comments of publicly visible unsafe functions and warns if there is no `# Safety`",
12351280
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc"
12361281
},
1282+
{
1283+
"key": "clippy::missing_spin_loop",
1284+
"name": "Check for empty spin loops",
1285+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_spin_loop"
1286+
},
12371287
{
12381288
"key": "clippy::mistyped_literal_suffixes",
12391289
"name": "Warns for mistyped suffix in literals",
@@ -1246,7 +1296,7 @@
12461296
},
12471297
{
12481298
"key": "clippy::mod_module_files",
1249-
"name": "Checks that module layout uses only self named module files, bans mod.rs files.",
1299+
"name": "Checks that module layout uses only self named module files, bans `mod.rs` files.",
12501300
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files"
12511301
},
12521302
{
@@ -1384,6 +1434,11 @@
13841434
"name": "Checks for lifetime annotations which can be removed by relying on lifetime elision.",
13851435
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes"
13861436
},
1437+
{
1438+
"key": "clippy::needless_match",
1439+
"name": "Checks for unnecessary `match` or match-like `if let` returns for `Option` and `Result` when functio",
1440+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_match"
1441+
},
13871442
{
13881443
"key": "clippy::needless_option_as_deref",
13891444
"name": "Checks for no-op uses of Option::{as_deref,as_deref_mut}, for example, `Option<&T>::as_deref()` retu",
@@ -1446,7 +1501,7 @@
14461501
},
14471502
{
14481503
"key": "clippy::new_without_default",
1449-
"name": "Checks for types with a `fn new() -> Self` method and no implementation of [`Default`](https://doc.r",
1504+
"name": "Checks for public types with a `pub fn new() -> Self` method and no implementation of [`Default`](ht",
14501505
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default"
14511506
},
14521507
{
@@ -1504,6 +1559,11 @@
15041559
"name": "Checks for usage of `ok().expect(..)`.",
15051560
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect"
15061561
},
1562+
{
1563+
"key": "clippy::only_used_in_recursion",
1564+
"name": "Checks for arguments that are only used in recursion with no side-effects.",
1565+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion"
1566+
},
15071567
{
15081568
"key": "clippy::op_ref",
15091569
"name": "Checks for arguments to `==` which have their address taken to satisfy a bound and suggests to deref",
@@ -1549,6 +1609,11 @@
15491609
"name": "Checks for calls to `.or(foo(..))`, `.unwrap_or(foo(..))`, etc., and suggests to use `or_else`, `unw",
15501610
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call"
15511611
},
1612+
{
1613+
"key": "clippy::or_then_unwrap",
1614+
"name": "Checks for `.or(…).unwrap()` calls to Options and Results.",
1615+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#or_then_unwrap"
1616+
},
15521617
{
15531618
"key": "clippy::out_of_bounds_indexing",
15541619
"name": "Checks for out of bounds array indexing with a constant index.",
@@ -1599,6 +1664,11 @@
15991664
"name": "Checks for operations where precedence may be unclear and suggests to add parentheses. Currently it",
16001665
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#precedence"
16011666
},
1667+
{
1668+
"key": "clippy::print_in_format_impl",
1669+
"name": "Checks for use of `println`, `print`, `eprintln` or `eprint` in an implementation of a formatting tr",
1670+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#print_in_format_impl"
1671+
},
16021672
{
16031673
"key": "clippy::print_literal",
16041674
"name": "This lint warns about the use of literals as `print!`/`println!` args.",
@@ -1674,6 +1744,11 @@
16741744
"name": "Checks for `Rc<Mutex<T>>`.",
16751745
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#rc_mutex"
16761746
},
1747+
{
1748+
"key": "clippy::recursive_format_impl",
1749+
"name": "Checks for format trait implementations (e.g. `Display`) with a recursive call to itself which uses",
1750+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#recursive_format_impl"
1751+
},
16771752
{
16781753
"key": "clippy::redundant_allocation",
16791754
"name": "Checks for use of redundant allocations anywhere in the code.",
@@ -1816,7 +1891,7 @@
18161891
},
18171892
{
18181893
"key": "clippy::self_named_module_files",
1819-
"name": "Checks that module layout uses only mod.rs files.",
1894+
"name": "Checks that module layout uses only `mod.rs` files.",
18201895
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#self_named_module_files"
18211896
},
18221897
{
@@ -2029,11 +2104,6 @@
20292104
"name": "Checks for `.to_digit(..).is_some()` on `char`s.",
20302105
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#to_digit_is_some"
20312106
},
2032-
{
2033-
"key": "clippy::to_string_in_display",
2034-
"name": "Checks for uses of `to_string()` in `Display` traits.",
2035-
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_display"
2036-
},
20372107
{
20382108
"key": "clippy::to_string_in_format_args",
20392109
"name": "Checks for [`ToString::to_string`](https://doc.rust-lang.org/std/string/trait.ToString.html#tymethod",
@@ -2109,6 +2179,11 @@
21092179
"name": "Checks for transmutes from a pointer to a reference.",
21102180
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ref"
21112181
},
2182+
{
2183+
"key": "clippy::transmute_undefined_repr",
2184+
"name": "Checks for transmutes between types which do not have a representation defined relative to each othe",
2185+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#transmute_undefined_repr"
2186+
},
21122187
{
21132188
"key": "clippy::transmutes_expressible_as_ptr_casts",
21142189
"name": "Checks for transmutes that could be a pointer cast.",
@@ -2201,14 +2276,24 @@
22012276
},
22022277
{
22032278
"key": "clippy::unnecessary_filter_map",
2204-
"name": "Checks for `filter_map` calls which could be replaced by `filter` or `map`. More specifically it che",
2279+
"name": "Checks for `filter_map` calls that could be replaced by `filter` or `map`. More specifically it chec",
22052280
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map"
22062281
},
2282+
{
2283+
"key": "clippy::unnecessary_find_map",
2284+
"name": "Checks for `find_map` calls that could be replaced by `find` or `map`. More specifically it checks i",
2285+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_find_map"
2286+
},
22072287
{
22082288
"key": "clippy::unnecessary_fold",
22092289
"name": "Checks for using `fold` when a more succinct alternative exists. Specifically, this checks for `fold",
22102290
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold"
22112291
},
2292+
{
2293+
"key": "clippy::unnecessary_join",
2294+
"name": "Checks for use of `.collect::<Vec<String>>().join(\"\")` on iterators.",
2295+
"url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_join"
2296+
},
22122297
{
22132298
"key": "clippy::unnecessary_lazy_evaluations",
22142299
"name": "As the counterpart to `or_fun_call`, this lint looks for unnecessary lazily evaluated closures on `O",

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@
2727

2828
public class ClippyRulesDefinitionTest {
2929

30-
@Test
31-
public void clippyExternalRepository() {
32-
RulesDefinition.Context context = new RulesDefinition.Context();
33-
ClippyRulesDefinition rulesDefinition = new ClippyRulesDefinition();
34-
rulesDefinition.define(context);
30+
@Test
31+
public void clippyExternalRepository() {
32+
RulesDefinition.Context context = new RulesDefinition.Context();
33+
ClippyRulesDefinition rulesDefinition = new ClippyRulesDefinition();
34+
rulesDefinition.define(context);
3535

36-
assertThat(context.repositories()).hasSize(1);
37-
RulesDefinition.Repository repository = context.repository("external_clippy");
38-
assertThat(repository).isNotNull();
39-
assertThat(repository.name()).isEqualTo("Clippy");
40-
assertThat(repository.language()).isEqualTo("rust");
41-
assertThat(repository.isExternal()).isTrue();
42-
assertThat(repository.rules().size()).isEqualTo(501);
36+
assertThat(context.repositories()).hasSize(1);
37+
RulesDefinition.Repository repository = context.repository("external_clippy");
38+
assertThat(repository).isNotNull();
39+
assertThat(repository.name()).isEqualTo("Clippy");
40+
assertThat(repository.language()).isEqualTo("rust");
41+
assertThat(repository.isExternal()).isTrue();
42+
assertThat(repository.rules().size()).isEqualTo(518);
4343

44-
RulesDefinition.Rule rule = repository.rule("clippy::absurd_extreme_comparisons");
45-
assertThat(rule).isNotNull();
46-
assertThat(rule.name()).isEqualTo("Checks for comparisons where one side of the relation is either the minimum or maximum value for its");
47-
assertThat(rule.htmlDescription()).isEqualTo("See description of Clippy rule <code>clippy::absurd_extreme_comparisons</code> at" +
48-
" the <a href=\"https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons\">Clippy website</a>.");
49-
assertThat(rule.tags()).isEmpty();
50-
}
44+
RulesDefinition.Rule rule = repository.rule("clippy::absurd_extreme_comparisons");
45+
assertThat(rule).isNotNull();
46+
assertThat(rule.name()).isEqualTo("Checks for comparisons where one side of the relation is either the minimum or maximum value for its");
47+
assertThat(rule.htmlDescription()).isEqualTo("See description of Clippy rule <code>clippy::absurd_extreme_comparisons</code> at" +
48+
" the <a href=\"https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons\">Clippy website</a>.");
49+
assertThat(rule.tags()).isEmpty();
50+
}
5151
}

0 commit comments

Comments
 (0)