diff --git a/README.md b/README.md index 4a802132..d13f252f 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ manage code quality. ### Compatibility with SonarQube versions : -| SonarQube | Rust plugin | -|-----------|---------------| -| > 9.9 LTS | not tested | -| 9.9 LTS | 0.2.1 | -| 8.9 - 9.9 | 0.1.0 | -| <8.9 | not supported | +| SonarQube | Community Rust plugin | +|-----------|-----------------------| +| 10.x | 0.2.2 | +| 9.9 LTS | 0.2.1 | +| 8.9 - 9.9 | 0.1.0 | +| <8.9 | not supported | It leverages [Clippy lints](https://rust-lang.github.io/rust-clippy/master/) to raise issues against coding rules, [LCOV](https://wiki.documentfoundation.org/Development/Lcov) diff --git a/community-rust-checks/pom.xml b/community-rust-checks/pom.xml index 2051f785..7f9f1787 100644 --- a/community-rust-checks/pom.xml +++ b/community-rust-checks/pom.xml @@ -6,7 +6,7 @@ org.elegoff community-rust - 0.2.2-SNAPSHOT + 0.2.2 community-rust-checks diff --git a/community-rust-frontend/pom.xml b/community-rust-frontend/pom.xml index fd0194a0..728efd8e 100644 --- a/community-rust-frontend/pom.xml +++ b/community-rust-frontend/pom.xml @@ -6,7 +6,7 @@ org.elegoff community-rust - 0.2.2-SNAPSHOT + 0.2.2 community-rust-frontend diff --git a/community-rust-plugin/pom.xml b/community-rust-plugin/pom.xml index 43a45d5b..e0bdc5d0 100644 --- a/community-rust-plugin/pom.xml +++ b/community-rust-plugin/pom.xml @@ -7,7 +7,7 @@ org.elegoff community-rust - 0.2.2-SNAPSHOT + 0.2.2 community-rust-plugin sonar-plugin diff --git a/community-rust-plugin/src/main/resources/org/elegoff/l10n/rust/rules/clippy/clippylints.json b/community-rust-plugin/src/main/resources/org/elegoff/l10n/rust/rules/clippy/clippylints.json index 4195ecc8..56740fa9 100644 --- a/community-rust-plugin/src/main/resources/org/elegoff/l10n/rust/rules/clippy/clippylints.json +++ b/community-rust-plugin/src/main/resources/org/elegoff/l10n/rust/rules/clippy/clippylints.json @@ -1,4 +1,9 @@ [ + { + "key": "clippy::absolute_paths", + "name": "Checks for usage of items through absolute paths, like `std::env::current_dir`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#absolute_paths" + }, { "key": "clippy::absurd_extreme_comparisons", "name": "Checks for comparisons where one side of the relation is either the minimum or maximum value for its", @@ -11,7 +16,7 @@ }, { "key": "clippy::allow_attributes", - "name": "of the `#[allow]` attribute and suggests replacing it with the `#[expect]` (See [RFC 2383](https://r", + "name": "Checks for usage of the `#[allow]` attribute and suggests replacing it with the `#[expect]` (See [RF", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes" }, { @@ -34,6 +39,11 @@ "name": "Checks for floating point literals that approximate constants which are defined in [`std::f32::const", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant" }, + { + "key": "clippy::arc_with_non_send_sync", + "name": "This lint warns when you use `Arc` with a type that does not implement `Send` or `Sync`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync" + }, { "key": "clippy::arithmetic_side_effects", "name": "Checks any kind of arithmetic operation of any type. Operators like `+`, `-`, `*` or `<<` are usual", @@ -51,7 +61,7 @@ }, { "key": "clippy::as_underscore", - "name": "Check for the usage of `as _` conversion using inferred type.", + "name": "Checks for the usage of `as _` conversion using inferred type.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore" }, { @@ -94,6 +104,11 @@ "name": "Checks for incompatible bit masks in comparisons. The formula for detecting if an expression of the", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask" }, + { + "key": "clippy::big_endian_bytes", + "name": "Checks for the usage of the `to_be_bytes` method and/or the function `from_be_bytes`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#big_endian_bytes" + }, { "key": "clippy::bind_instead_of_map", "name": "Checks for usage of `_.and_then(|x| Some(y))`, `_.and_then(|x| Ok(y))` or `_.or_else(|x| Err(y))`.", @@ -221,7 +236,7 @@ }, { "key": "clippy::cast_possible_wrap", - "name": "Checks for casts from an unsigned type to a signed type of the same size. Performing such a cast is", + "name": "Checks for casts from an unsigned type to a signed type of the same size, or possibly smaller due to", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap" }, { @@ -234,11 +249,6 @@ "name": "Checks for casts, using `as` or `pointer::cast`, from a less-strictly-aligned pointer to a more-stri", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_ptr_alignment" }, - { - "key": "clippy::cast_ref_to_mut", - "name": "Checks for casts of `&T` to `&mut T` anywhere in the code.", - "url": "https://rust-lang.github.io/rust-clippy/master/index.html#cast_ref_to_mut" - }, { "key": "clippy::cast_sign_loss", "name": "Checks for casts from a signed to an unsigned numerical type. In this case, negative values wrap aro", @@ -294,11 +304,6 @@ "name": "Checks for usage of `cloned()` on an `Iterator` or `Option` where `copied()` could be used instead.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied" }, - { - "key": "clippy::cmp_nan", - "name": "Checks for comparisons to NaN.", - "url": "https://rust-lang.github.io/rust-clippy/master/index.html#cmp_nan" - }, { "key": "clippy::cmp_null", "name": "This lint checks for equality comparisons with `ptr::null`", @@ -391,7 +396,7 @@ }, { "key": "clippy::default_constructed_unit_structs", - "name": "Check for construction on unit struct using `default`.", + "name": "Checks for construction on unit struct using `default`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs" }, { @@ -514,6 +519,11 @@ "name": "Checks for unnecessary double parentheses.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#double_parens" }, + { + "key": "clippy::drain_collect", + "name": "Checks for calls to `.drain()` that clear the collection, immediately followed by a call to `.collec", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#drain_collect" + }, { "key": "clippy::drop_non_drop", "name": "Checks for calls to `std::mem::drop` with a value that does not implement `Drop`.", @@ -604,6 +614,16 @@ "name": "Checks for `.err().expect()` calls on the `Result` type.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#err_expect" }, + { + "key": "clippy::error_impl_error", + "name": "Checks for types named `Error` that implement `Error`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#error_impl_error" + }, + { + "key": "clippy::excessive_nesting", + "name": "Checks for blocks which are nested beyond a certain threshold. Note: Even though this lint is warn-", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#excessive_nesting" + }, { "key": "clippy::excessive_precision", "name": "Checks for float literals with a precision greater than that supported by the underlying type.", @@ -699,6 +719,11 @@ "name": "Checks for `FileType::is_file()`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#filetype_is_file" }, + { + "key": "clippy::filter_map_bool_then", + "name": "Checks for usage of `bool::then` in `Iterator::filter_map`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_bool_then" + }, { "key": "clippy::filter_map_identity", "name": "Checks for usage of `filter_map(|x| x)`.", @@ -749,11 +774,6 @@ "name": "Checks for comparisons with an address of a function item.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#fn_address_comparisons" }, - { - "key": "clippy::fn_null_check", - "name": "Checks for comparing a function pointer to null.", - "url": "https://rust-lang.github.io/rust-clippy/master/index.html#fn_null_check" - }, { "key": "clippy::fn_params_excessive_bools", "name": "Checks for excessive use of bools in function definitions.", @@ -784,6 +804,11 @@ "name": "Checks for calls to `std::mem::forget` with a value that does not implement `Drop`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop" }, + { + "key": "clippy::format_collect", + "name": "Checks for usage of `.map(|_| format!(..)).collect::()`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#format_collect" + }, { "key": "clippy::format_in_format_args", "name": "Detects `format!` within the arguments of another macro that does formatting such as `format!` itsel", @@ -794,6 +819,11 @@ "name": "Detects cases where the result of a `format!` call is appended to an existing `String`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string" }, + { + "key": "clippy::four_forward_slashes", + "name": "Checks for outer doc comments written with 4 forward slashes (`////`).", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#four_forward_slashes" + }, { "key": "clippy::from_iter_instead_of_collect", "name": "Checks for `from_iter()` function calls on types that implement the `FromIterator` trait.", @@ -834,6 +864,11 @@ "name": "Checks for usage of `.get().unwrap()` (or `.get_mut().unwrap`) on a standard library type which impl", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap" }, + { + "key": "clippy::host_endian_bytes", + "name": "Checks for the usage of the `to_ne_bytes` method and/or the function `from_ne_bytes`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#host_endian_bytes" + }, { "key": "clippy::identity_op", "name": "Checks for identity operations, e.g., `x + 0`.", @@ -864,6 +899,11 @@ "name": "Checks for consecutive `if`s with the same condition.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond" }, + { + "key": "clippy::ignored_unit_patterns", + "name": "Checks for usage of `_` in patterns of type `()`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns" + }, { "key": "clippy::impl_trait_in_params", "name": "Lints when `impl Trait` is being used in a function's parameters.", @@ -894,6 +934,16 @@ "name": "Checks for implicit saturating subtraction.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub" }, + { + "key": "clippy::implied_bounds_in_impls", + "name": "Looks for bounds in `impl Trait` in return position that are implied by other bounds. This can happe", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls" + }, + { + "key": "clippy::impossible_comparisons", + "name": "Checks for double comparisons that can never succeed", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#impossible_comparisons" + }, { "key": "clippy::imprecise_flops", "name": "Looks for floating-point expressions that can be expressed using built-in methods to improve accurac", @@ -994,6 +1044,11 @@ "name": "Checks for `into_iter` calls on references which should be replaced by `iter` or `iter_mut`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref" }, + { + "key": "clippy::into_iter_without_iter", + "name": "This is the opposite of the `iter_without_into_iter` lint. It looks for `IntoIterator for (&|&mut) T", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_without_iter" + }, { "key": "clippy::invalid_null_ptr_usage", "name": "This lint checks for invalid usages of `ptr::null`.", @@ -1009,11 +1064,6 @@ "name": "Checks for comparisons where the relation is always either true or false, but where one side has bee", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#invalid_upcast_comparisons" }, - { - "key": "clippy::invalid_utf8_in_unchecked", - "name": "Checks for `std::str::from_utf8_unchecked` with an invalid UTF-8 literal", - "url": "https://rust-lang.github.io/rust-clippy/master/index.html#invalid_utf8_in_unchecked" - }, { "key": "clippy::invisible_characters", "name": "Checks for invisible Unicode characters in the code.", @@ -1084,6 +1134,11 @@ "name": "Checks for calls to `iter`, `iter_mut` or `into_iter` on collections containing a single item", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_on_single_items" }, + { + "key": "clippy::iter_out_of_bounds", + "name": "Looks for iterator combinator calls such as `.take(x)` or `.skip(x)` where `x` is greater than the a", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_out_of_bounds" + }, { "key": "clippy::iter_overeager_cloned", "name": "Checks for usage of `_.cloned().()` where call to `.cloned()` can be postponed.", @@ -1094,11 +1149,21 @@ "name": "Checks for usage of `.skip(x).next()` on iterators.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next" }, + { + "key": "clippy::iter_skip_zero", + "name": "Checks for usage of `.skip(0)` on iterators.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_zero" + }, { "key": "clippy::iter_with_drain", "name": "Checks for usage of `.drain(..)` on `Vec` and `VecDeque` for iteration.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_with_drain" }, + { + "key": "clippy::iter_without_into_iter", + "name": "Looks for `iter` and `iter_mut` methods without an associated `IntoIterator for (&|&mut) Type` imple", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#iter_without_into_iter" + }, { "key": "clippy::iterator_step_by_zero", "name": "Checks for calling `.step_by(0)` on iterators which panics.", @@ -1139,6 +1204,11 @@ "name": "Checks for local arrays that may be too large.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#large_stack_arrays" }, + { + "key": "clippy::large_stack_frames", + "name": "Checks for functions that use a lot of stack space. This often happens when constructing a large ty", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#large_stack_frames" + }, { "key": "clippy::large_types_passed_by_value", "name": "Checks for functions taking arguments by value, where the argument type is `Copy` and large enough t", @@ -1199,6 +1269,11 @@ "name": "Checks for usage of any `LinkedList`, suggesting to use a `Vec` or a `VecDeque` (formerly called `Ri", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist" }, + { + "key": "clippy::little_endian_bytes", + "name": "Checks for the usage of the `to_le_bytes` method and/or the function `from_le_bytes`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#little_endian_bytes" + }, { "key": "clippy::lossy_float_literal", "name": "Checks for whole number float literals that cannot be represented as the underlying type without los", @@ -1246,7 +1321,7 @@ }, { "key": "clippy::manual_find", - "name": "Check for manual implementations of Iterator::find", + "name": "Checks for manual implementations of Iterator::find", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_find" }, { @@ -1256,9 +1331,14 @@ }, { "key": "clippy::manual_flatten", - "name": "Check for unnecessary `if let` usage in a for loop where only the `Some` or `Ok` variant of the iter", + "name": "Checks for unnecessary `if let` usage in a for loop where only the `Some` or `Ok` variant of the ite", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten" }, + { + "key": "clippy::manual_hash_one", + "name": "Checks for cases where [`BuildHasher::hash_one`] can be used. [`BuildHasher::hash_one`]: https://do", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_hash_one" + }, { "key": "clippy::manual_instant_elapsed", "name": "Lints subtraction between `Instant::now()` and another `Instant`.", @@ -1266,9 +1346,19 @@ }, { "key": "clippy::manual_is_ascii_check", - "name": "Suggests to use dedicated built-in methods, `is_ascii_(lowercase|uppercase|digit)` for checking on c", + "name": "Suggests to use dedicated built-in methods, `is_ascii_(lowercase|uppercase|digit|hexdigit)` for chec", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check" }, + { + "key": "clippy::manual_is_finite", + "name": "Checks for manual `is_finite` reimplementations (i.e., `x != ::INFINITY && x != ::NEG_", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_finite" + }, + { + "key": "clippy::manual_is_infinite", + "name": "Checks for manual `is_infinite` reimplementations (i.e., `x == ::INFINITY || x == ::NE", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_infinite" + }, { "key": "clippy::manual_let_else", "name": "Warn of cases where `let...else` could be used", @@ -1309,6 +1399,11 @@ "name": "Checks for expressions like `x >= 3 && x < 8` that could be more readably expressed as `(3..8).conta", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains" }, + { + "key": "clippy::manual_range_patterns", + "name": "Looks for combined OR patterns that are all contained in a specific range, e.g. `6 | 4 | 5 | 9 | 7 |", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns" + }, { "key": "clippy::manual_rem_euclid", "name": "Checks for an expression like `((x % 4) + 4) % 4` which is a common manual reimplementation of `x.re", @@ -1354,6 +1449,11 @@ "name": "Checks for manual swapping. Note that the lint will not be emitted in const blocks, as the suggesti", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap" }, + { + "key": "clippy::manual_try_fold", + "name": "Checks for usage of `Iterator::fold` with a type that implements `Try`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold" + }, { "key": "clippy::manual_unwrap_or", "name": "Finds patterns that reimplement `Option::unwrap_or` or `Result::unwrap_or`.", @@ -1441,7 +1541,7 @@ }, { "key": "clippy::match_same_arms", - "name": "Checks for `match` with identical arm bodies.", + "name": "Checks for `match` with identical arm bodies. Note: Does not lint on wildcards if the `non_exhausti", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms" }, { @@ -1469,9 +1569,14 @@ "name": "Checks for iteration that may be infinite.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#maybe_infinite_iter" }, + { + "key": "clippy::maybe_misused_cfg", + "name": "Checks for `#[cfg(features = \"...\")]` and suggests to replace it with `#[cfg(feature = \"...\")]`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#maybe_misused_cfg" + }, { "key": "clippy::mem_forget", - "name": "Checks for usage of `std::mem::forget(t)` where `t` is `Drop`.", + "name": "Checks for usage of `std::mem::forget(t)` where `t` is `Drop` or has a field that implements `Drop`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#mem_forget" }, { @@ -1489,6 +1594,11 @@ "name": "Checks for `mem::replace(&mut _, mem::uninitialized())` and `mem::replace(&mut _, mem::zeroed())`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_uninit" }, + { + "key": "clippy::min_ident_chars", + "name": "Checks for idents which comprise of a single letter. Note: This lint can be very noisy when enabled", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#min_ident_chars" + }, { "key": "clippy::min_max", "name": "Checks for expressions where `std::cmp::min` and `max` are used to clamp values, but switched so tha", @@ -1519,6 +1629,11 @@ "name": "Checks assertions without a custom panic message.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_assert_message" }, + { + "key": "clippy::missing_asserts_for_indexing", + "name": "Checks for repeated slice indexing without asserting beforehand that the length is greater than the", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_asserts_for_indexing" + }, { "key": "clippy::missing_const_for_fn", "name": "Suggests the use of `const` in functions and methods where possible.", @@ -1539,6 +1654,11 @@ "name": "Checks the doc comments of publicly visible functions that return a `Result` type and warns if there", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc" }, + { + "key": "clippy::missing_fields_in_debug", + "name": "Checks for manual [`core::fmt::Debug`](https://doc.rust-lang.org/core/fmt/trait.Debug.html) implemen", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_fields_in_debug" + }, { "key": "clippy::missing_inline_in_public_items", "name": "It lints if an exported function, method, trait method with default impl, or trait method impl is no", @@ -1556,7 +1676,7 @@ }, { "key": "clippy::missing_spin_loop", - "name": "Check for empty spin loops", + "name": "Checks for empty spin loops", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#missing_spin_loop" }, { @@ -1704,6 +1824,11 @@ "name": "Checks for bindings that needlessly destructure a reference and borrow the inner value with `&ref`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference" }, + { + "key": "clippy::needless_borrows_for_generic_args", + "name": "Checks for borrow operations (`&`) that used as a generic argument to a function when the borrowed v", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args" + }, { "key": "clippy::needless_collect", "name": "Checks for functions collecting an iterator when collect is not needed.", @@ -1729,6 +1854,11 @@ "name": "Checks for usage of `for_each` that would be more simply written as a `for` loop.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_for_each" }, + { + "key": "clippy::needless_if", + "name": "Checks for empty `if` branches with no else branch.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_if" + }, { "key": "clippy::needless_late_init", "name": "Checks for late initializations that can be replaced by a `let` statement with an initializer.", @@ -1759,11 +1889,21 @@ "name": "The lint checks for parenthesis on literals in range statements that are superfluous.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_parens_on_range_literals" }, + { + "key": "clippy::needless_pass_by_ref_mut", + "name": "Check if a `&mut` function argument is actually used mutably. Be careful if the function is publicl", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut" + }, { "key": "clippy::needless_pass_by_value", "name": "Checks for functions taking arguments by value, but not consuming them in its body.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value" }, + { + "key": "clippy::needless_pub_self", + "name": "Checks for usage of `pub(self)` and `pub(in self)`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_pub_self" + }, { "key": "clippy::needless_question_mark", "name": "Suggests alternatives for useless applications of `?` in terminating expressions", @@ -1774,11 +1914,26 @@ "name": "Checks for looping over the range of `0..len` of some collection just to get the values by index.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop" }, + { + "key": "clippy::needless_raw_string_hashes", + "name": "Checks for raw string literals with an unnecessary amount of hashes around them.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes" + }, + { + "key": "clippy::needless_raw_strings", + "name": "Checks for raw string literals where a string literal can be used instead.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_strings" + }, { "key": "clippy::needless_return", "name": "Checks for return statements at the end of a block.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_return" }, + { + "key": "clippy::needless_return_with_question_mark", + "name": "Checks for return statements on `Err` paired with the `?` operator.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#needless_return_with_question_mark" + }, { "key": "clippy::needless_splitn", "name": "Checks for usage of `str::splitn` (or `str::rsplitn`) where using `str::split` would be the same.", @@ -1844,6 +1999,16 @@ "name": "Checks for non-ASCII characters in string and char literals.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal" }, + { + "key": "clippy::non_canonical_clone_impl", + "name": "Checks for non-canonical implementations of `Clone` when `Copy` is already implemented.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_clone_impl" + }, + { + "key": "clippy::non_canonical_partial_ord_impl", + "name": "Checks for non-canonical implementations of `PartialOrd` when `Ord` is already implemented.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl" + }, { "key": "clippy::non_minimal_cfg", "name": "Checks for `any` and `all` combinators in `cfg` with only one condition.", @@ -1971,7 +2136,7 @@ }, { "key": "clippy::panic_in_result_fn", - "name": "Checks for usage of `panic!`, `unimplemented!`, `todo!`, `unreachable!` or assertions in a function", + "name": "Checks for usage of `panic!` or assertions in a function of type result.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#panic_in_result_fn" }, { @@ -1999,6 +2164,11 @@ "name": "* Checks for [push](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.push) calls on `Pa", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#path_buf_push_overwrite" }, + { + "key": "clippy::path_ends_with_ext", + "name": "Looks for calls to `Path::ends_with` calls where the argument looks like a file extension. By defau", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext" + }, { "key": "clippy::pattern_type_mismatch", "name": "Checks for patterns that aren't exact representations of the types they are applied to. To satisfy", @@ -2079,6 +2249,16 @@ "name": "Restricts the usage of `pub use ...`", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#pub_use" }, + { + "key": "clippy::pub_with_shorthand", + "name": "Checks for usage of `pub()` with `in`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#pub_with_shorthand" + }, + { + "key": "clippy::pub_without_shorthand", + "name": "Checks for usage of `pub()` without `in`. Note: As you cannot write a module's path in `pub(>`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#rc_mutex" }, + { + "key": "clippy::read_line_without_trim", + "name": "Looks for calls to [`Stdin::read_line`] to read a line from the standard input into a string, then l", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#read_line_without_trim" + }, { "key": "clippy::read_zero_byte_vec", "name": "This lint catches reads into a zero-length `Vec`. Especially in the case of a call to `with_capacity", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#read_zero_byte_vec" }, + { + "key": "clippy::readonly_write_lock", + "name": "Looks for calls to `RwLock::write` where the lock is only used for reading.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#readonly_write_lock" + }, { "key": "clippy::recursive_format_impl", "name": "Checks for format trait implementations (e.g. `Display`) with a recursive call to itself which uses", @@ -2134,11 +2324,21 @@ "name": "Checks for usage of redundant allocations anywhere in the code.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_allocation" }, + { + "key": "clippy::redundant_as_str", + "name": "Checks for usage of `as_str()` on a `String`` chained with a method available on the `String` itself", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_as_str" + }, { "key": "clippy::redundant_async_block", "name": "Checks for `async` block that only returns `await` on a future.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_async_block" }, + { + "key": "clippy::redundant_at_rest_pattern", + "name": "Checks for `[all @ ..]` patterns.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_at_rest_pattern" + }, { "key": "clippy::redundant_clone", "name": "Checks for a redundant `clone()` (and its relatives) which clones an owned value that is going to be", @@ -2159,6 +2359,11 @@ "name": "Checks for closures which only invoke a method on the closure argument and can be replaced by refere", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls" }, + { + "key": "clippy::redundant_comparisons", + "name": "Checks for ineffective double comparisons against constants.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_comparisons" + }, { "key": "clippy::redundant_else", "name": "Checks for `else` blocks that can be removed without changing semantics.", @@ -2174,6 +2379,16 @@ "name": "Checks for fields in struct literals where shorthands could be used.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names" }, + { + "key": "clippy::redundant_guards", + "name": "Checks for unnecessary guards in match expressions.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards" + }, + { + "key": "clippy::redundant_locals", + "name": "Checks for redundant redefinitions of local bindings.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals" + }, { "key": "clippy::redundant_pattern", "name": "Checks for patterns in the form `name @ _`.", @@ -2199,6 +2414,11 @@ "name": "Checks for constants and statics with an explicit `'static` lifetime.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes" }, + { + "key": "clippy::redundant_type_annotations", + "name": "Warns about needless / redundant type annotations.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#redundant_type_annotations" + }, { "key": "clippy::ref_binding_to_reference", "name": "Checks for `ref` bindings which create a reference to a reference.", @@ -2219,6 +2439,11 @@ "name": "Checks for usage of `.repeat(1)` and suggest the following method for each types. - `.to_string()` f", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#repeat_once" }, + { + "key": "clippy::reserve_after_initialization", + "name": "Informs the user about a more concise way to create a vector with a known capacity.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization" + }, { "key": "clippy::rest_pat_in_fully_bound_structs", "name": "Checks for unnecessary '..' pattern binding on struct when all fields are explicitly matched.", @@ -2349,9 +2574,14 @@ "name": "Checks for methods that should live in a trait implementation of a `std` trait (see [llogiq's blog p", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait" }, + { + "key": "clippy::should_panic_without_expect", + "name": "Checks for `#[should_panic]` attributes without specifying the expected panic message.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#should_panic_without_expect" + }, { "key": "clippy::significant_drop_in_scrutinee", - "name": "Check for temporaries returned from function calls in a match scrutinee that have the `clippy::has_s", + "name": "Checks for temporaries returned from function calls in a match scrutinee that have the `clippy::has_", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee" }, { @@ -2364,6 +2594,11 @@ "name": "Checks for names that are very similar and thus confusing. Note: this lint looks for similar names", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#similar_names" }, + { + "key": "clippy::single_call_fn", + "name": "Checks for functions that are only used once. Does not lint tests.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#single_call_fn" + }, { "key": "clippy::single_char_add_str", "name": "Warns when using `push_str`/`insert_str` with a single-character string literal where `push`/`insert", @@ -2391,7 +2626,7 @@ }, { "key": "clippy::single_match", - "name": "Checks for matches with a single arm where an `if let` will usually suffice.", + "name": "Checks for matches with a single arm where an `if let` will usually suffice. This intentionally doe", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#single_match" }, { @@ -2399,6 +2634,11 @@ "name": "Checks for matches with two arms where an `if let else` will usually suffice.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else" }, + { + "key": "clippy::single_range_in_vec_init", + "name": "Checks for `Vec` or array initializations that contain only one range.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init" + }, { "key": "clippy::size_of_in_element_count", "name": "Detects expressions where `size_of::` or `size_of_val::` is used as a count of elements of typ", @@ -2464,6 +2704,11 @@ "name": "Checks for the `as_bytes` method called on string literals that contain only ASCII characters.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#string_lit_as_bytes" }, + { + "key": "clippy::string_lit_chars_any", + "name": "Checks for `.chars().any(|i| i == c)`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#string_lit_chars_any" + }, { "key": "clippy::string_slice", "name": "Checks for slice operations on strings", @@ -2694,11 +2939,21 @@ "name": "Checks for usage of `Err(x)?`.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#try_err" }, + { + "key": "clippy::tuple_array_conversions", + "name": "Checks for tuple<=>array conversions that are not done with `.into()`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#tuple_array_conversions" + }, { "key": "clippy::type_complexity", "name": "Checks for types used in structs, parameters and `let` declarations above a certain complexity thres", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity" }, + { + "key": "clippy::type_id_on_box", + "name": "Looks for calls to ` as Any>::type_id`.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#type_id_on_box" + }, { "key": "clippy::type_repetition_in_bounds", "name": "This lint warns about unnecessary type repetitions in trait bounds", @@ -2714,11 +2969,6 @@ "name": "Checks for `unsafe` blocks and impls without a `// SAFETY: ` comment explaining why the unsafe opera", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks" }, - { - "key": "clippy::undropped_manually_drops", - "name": "Prevents the safe `std::mem::drop` function from being called on `std::mem::ManuallyDrop`.", - "url": "https://rust-lang.github.io/rust-clippy/master/index.html#undropped_manually_drops" - }, { "key": "clippy::unicode_not_nfc", "name": "Checks for string literals that contain Unicode in a form that is not equal to its [NFC-recompositio", @@ -2771,7 +3021,7 @@ }, { "key": "clippy::unnecessary_cast", - "name": "Checks for casts to the same type, casts of int literals to integer types and casts of float literal", + "name": "Checks for casts to the same type, casts of int literals to integer types, casts of float literals t", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast" }, { @@ -2799,6 +3049,16 @@ "name": "As the counterpart to `or_fun_call`, this lint looks for unnecessary lazily evaluated closures on `O", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations" }, + { + "key": "clippy::unnecessary_literal_unwrap", + "name": "Checks for `.unwrap()` related calls on `Result`s and `Option`s that are constructed.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap" + }, + { + "key": "clippy::unnecessary_map_on_constructor", + "name": "Suggest removing the use of a may (or map_err) method when an Option or Result is being construted.", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_on_constructor" + }, { "key": "clippy::unnecessary_mut_passed", "name": "Detects passing a mutable reference to a function that only requires an immutable reference.", @@ -2945,9 +3205,9 @@ "url": "https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result" }, { - "key": "clippy::unwrap_or_else_default", - "name": "Checks for usage of `_.unwrap_or_else(Default::default)` on `Option` and `Result` values.", - "url": "https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_else_default" + "key": "clippy::unwrap_or_default", + "name": "Checks for usages of the following functions with an argument that constructs a default value (e.g.,", + "url": "https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default" }, { "key": "clippy::unwrap_used", @@ -3006,7 +3266,7 @@ }, { "key": "clippy::useless_vec", - "name": "Checks for usage of `&vec![..]` when using `&[..]` would be possible.", + "name": "Checks for usage of `vec![..]` when using `[..]` would be possible.", "url": "https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec" }, { diff --git a/community-rust-plugin/src/test/java/org/elegoff/plugins/communityrust/clippy/ClippyRulesDefinitionTest.java b/community-rust-plugin/src/test/java/org/elegoff/plugins/communityrust/clippy/ClippyRulesDefinitionTest.java index cca3fcbc..6ae4bb0c 100644 --- a/community-rust-plugin/src/test/java/org/elegoff/plugins/communityrust/clippy/ClippyRulesDefinitionTest.java +++ b/community-rust-plugin/src/test/java/org/elegoff/plugins/communityrust/clippy/ClippyRulesDefinitionTest.java @@ -40,7 +40,7 @@ void clippyExternalRepository() { assertThat(repository.name()).isEqualTo("Clippy"); assertThat(repository.language()).isEqualTo("rust"); assertThat(repository.isExternal()).isTrue(); - assertThat(repository.rules()).hasSize(625); + assertThat(repository.rules()).hasSize(677); RulesDefinition.Rule rule = repository.rule("clippy::absurd_extreme_comparisons"); assertThat(rule).isNotNull(); diff --git a/pom.xml b/pom.xml index 5c17400d..571c5444 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.elegoff community-rust - 0.2.2-SNAPSHOT + 0.2.2 pom