Skip to content

Commit 672ef2e

Browse files
committed
Make lint descriptions short and to the point; always fitting the column "triggers on".
1 parent 3b5ff0f commit 672ef2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+332
-237
lines changed

README.md

+68-68
Large diffs are not rendered by default.

clippy_lints/src/approx_const.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ use utils::span_lint;
2828
declare_lint! {
2929
pub APPROX_CONSTANT,
3030
Warn,
31-
"the approximate of a known float constant (in `std::f64::consts` or `std::f32::consts`) \
32-
is found; suggests to use the constant"
31+
"the approximate of a known float constant (in `std::fXX::consts`)"
3332
}
3433

3534
// Tuples are of the form (constant, name, min_digits)

clippy_lints/src/arithmetic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use utils::span_lint;
1717
/// ```
1818
declare_restriction_lint! {
1919
pub INTEGER_ARITHMETIC,
20-
"Any integer arithmetic statement"
20+
"any integer arithmetic statement"
2121
}
2222

2323
/// **What it does:** Checks for float arithmetic.
@@ -33,7 +33,7 @@ declare_restriction_lint! {
3333
/// ```
3434
declare_restriction_lint! {
3535
pub FLOAT_ARITHMETIC,
36-
"Any floating-point arithmetic statement"
36+
"any floating-point arithmetic statement"
3737
}
3838

3939
#[derive(Copy, Clone, Default)]

clippy_lints/src/array_indexing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use utils::{self, higher};
2424
declare_lint! {
2525
pub OUT_OF_BOUNDS_INDEXING,
2626
Deny,
27-
"out of bound constant indexing"
27+
"out of bounds constant indexing"
2828
}
2929

3030
/// **What it does:** Checks for usage of indexing or slicing.

clippy_lints/src/assign_ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use utils::{higher, sugg};
1616
/// ```
1717
declare_restriction_lint! {
1818
pub ASSIGN_OPS,
19-
"any assignment operation"
19+
"any compound assignment operation"
2020
}
2121

2222
/// **What it does:** Checks for `a = a op b` or `a = b commutative_op a` patterns.

clippy_lints/src/attrs.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ use utils::paths;
3030
/// fn not_quite_hot_code(..) { ... }
3131
/// ```
3232
declare_lint! {
33-
pub INLINE_ALWAYS, Warn,
34-
"`#[inline(always)]` is a bad idea in most cases"
33+
pub INLINE_ALWAYS,
34+
Warn,
35+
"use of `#[inline(always)]`"
3536
}
3637

3738
/// **What it does:** Checks for `#[deprecated]` annotations with a `since`
@@ -48,8 +49,9 @@ declare_lint! {
4849
/// fn something_else(..) { ... }
4950
/// ```
5051
declare_lint! {
51-
pub DEPRECATED_SEMVER, Warn,
52-
"`Warn` on `#[deprecated(since = \"x\")]` where x is not semver"
52+
pub DEPRECATED_SEMVER,
53+
Warn,
54+
"use of `#[deprecated(since = \"x\")]` where x is not semver"
5355
}
5456

5557
#[derive(Copy,Clone)]

clippy_lints/src/bit_mask.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ use utils::span_lint;
3939
declare_lint! {
4040
pub BAD_BIT_MASK,
4141
Warn,
42-
"expressions of the form `_ & mask == select` that will only ever return `true` or `false` \
43-
(because in the example `select` containing bits that `mask` doesn't have)"
42+
"expressions of the form `_ & mask == select` that will only ever return `true` or `false`"
4443
}
4544

4645
/// **What it does:** Checks for bit masks in comparisons which can be removed

clippy_lints/src/block_in_if_condition.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ use utils::*;
1616
/// if { true } ..
1717
/// ```
1818
declare_lint! {
19-
pub BLOCK_IN_IF_CONDITION_EXPR, Warn,
20-
"braces can be eliminated in conditions that are expressions, e.g `if { true } ...`"
19+
pub BLOCK_IN_IF_CONDITION_EXPR,
20+
Warn,
21+
"braces that can be eliminated in conditions, e.g `if { true } ...`"
2122
}
2223

2324
/// **What it does:** Checks for `if` conditions that use blocks containing
@@ -34,9 +35,9 @@ declare_lint! {
3435
/// if somefunc(|x| { x == 47 }) ..
3536
/// ```
3637
declare_lint! {
37-
pub BLOCK_IN_IF_CONDITION_STMT, Warn,
38-
"avoid complex blocks in conditions, instead move the block higher and bind it \
39-
with 'let'; e.g: `if { let x = true; x } ...`"
38+
pub BLOCK_IN_IF_CONDITION_STMT,
39+
Warn,
40+
"complex blocks in conditions, e.g. `if { let x = true; x } ...`"
4041
}
4142

4243
#[derive(Copy,Clone)]

clippy_lints/src/booleans.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ use utils::{span_lint_and_then, in_macro, snippet_opt, SpanlessEq};
2020
/// if a && true // should be: if a
2121
/// if !(a == b) // should be: if a != b
2222
declare_lint! {
23-
pub NONMINIMAL_BOOL, Allow,
24-
"checks for boolean expressions that can be written more concisely"
23+
pub NONMINIMAL_BOOL,
24+
Allow,
25+
"boolean expressions that can be written more concisely"
2526
}
2627

2728
/// **What it does:** Checks for boolean expressions that contain terminals that
@@ -37,8 +38,9 @@ declare_lint! {
3738
/// ```
3839
/// The `b` is unnecessary, the expression is equivalent to `if a`.
3940
declare_lint! {
40-
pub LOGIC_BUG, Warn,
41-
"checks for boolean expressions that contain terminals which can be eliminated"
41+
pub LOGIC_BUG,
42+
Warn,
43+
"boolean expressions that contain terminals which can be eliminated"
4244
}
4345

4446
#[derive(Copy,Clone)]

clippy_lints/src/cyclomatic_complexity.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ use utils::{in_macro, LimitStack, span_help_and_lint, paths, match_type};
2020
///
2121
/// **Example:** No. You'll see it when you get the warning.
2222
declare_lint! {
23-
pub CYCLOMATIC_COMPLEXITY, Warn,
24-
"finds functions that should be split up into multiple functions"
23+
pub CYCLOMATIC_COMPLEXITY,
24+
Warn,
25+
"functions that should be split up into multiple functions"
2526
}
2627

2728
pub struct CyclomaticComplexity {

clippy_lints/src/doc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ use utils::span_lint;
2121
/// fn doit(foo_bar) { .. }
2222
/// ```
2323
declare_lint! {
24-
pub DOC_MARKDOWN, Warn,
25-
"checks for the presence of `_`, `::` or camel-case outside ticks in documentation"
24+
pub DOC_MARKDOWN,
25+
Warn,
26+
"presence of `_`, `::` or camel-case outside backticks in documentation"
2627
}
2728

2829
#[derive(Clone)]

clippy_lints/src/drop_ref.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ use utils::{match_def_path, paths, span_note_and_lint};
2121
/// operation_that_requires_mutex_to_be_unlocked();
2222
/// ```
2323
declare_lint! {
24-
pub DROP_REF, Warn,
25-
"call to `std::mem::drop` with a reference instead of an owned value, \
26-
which will not call the `Drop::drop` method on the underlying value"
24+
pub DROP_REF,
25+
Warn,
26+
"calls to `std::mem::drop` with a reference instead of an owned value"
2727
}
2828

2929
#[allow(missing_copy_implementations)]

clippy_lints/src/enum_clike.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ use utils::span_lint;
2323
/// }
2424
/// ```
2525
declare_lint! {
26-
pub ENUM_CLIKE_UNPORTABLE_VARIANT, Warn,
27-
"finds C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32`"
26+
pub ENUM_CLIKE_UNPORTABLE_VARIANT,
27+
Warn,
28+
"C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32`"
2829
}
2930

3031
pub struct UnportableVariant;

clippy_lints/src/enum_glob_use.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ use utils::span_lint;
2121
/// ```rust
2222
/// use std::cmp::Ordering::*;
2323
/// ```
24-
declare_lint! { pub ENUM_GLOB_USE, Allow,
25-
"finds use items that import all variants of an enum" }
24+
declare_lint! {
25+
pub ENUM_GLOB_USE,
26+
Allow,
27+
"use items that import all variants of an enum"
28+
}
2629

2730
pub struct EnumGlobUse;
2831

clippy_lints/src/enum_variants.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ use utils::{camel_case_from, camel_case_until, in_macro};
2323
/// }
2424
/// ```
2525
declare_lint! {
26-
pub ENUM_VARIANT_NAMES, Warn,
27-
"finds enums where all variants share a prefix/postfix"
26+
pub ENUM_VARIANT_NAMES,
27+
Warn,
28+
"enums where all variants share a prefix/postfix"
2829
}
2930

3031
/// **What it does:** Detects type names that are prefixed or suffixed by the
@@ -41,8 +42,9 @@ declare_lint! {
4142
/// }
4243
/// ```
4344
declare_lint! {
44-
pub STUTTER, Allow,
45-
"finds type names prefixed/postfixed with their containing module's name"
45+
pub STUTTER,
46+
Allow,
47+
"type names prefixed/postfixed with their containing module's name"
4648
}
4749

4850
pub struct EnumVariantNames {

clippy_lints/src/escape.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ pub struct Pass {
3535
/// }
3636
/// ```
3737
declare_lint! {
38-
pub BOXED_LOCAL, Warn, "using `Box<T>` where unnecessary"
38+
pub BOXED_LOCAL,
39+
Warn,
40+
"using `Box<T>` where unnecessary"
3941
}
4042

4143
fn is_non_trait_box(ty: ty::Ty) -> bool {

clippy_lints/src/eta_reduction.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ pub struct EtaPass;
2222
/// ```
2323
/// where `foo(_)` is a plain function that takes the exact argument type of `x`.
2424
declare_lint! {
25-
pub REDUNDANT_CLOSURE, Warn,
26-
"using redundant closures, i.e. `|a| foo(a)` (which can be written as just `foo`)"
25+
pub REDUNDANT_CLOSURE,
26+
Warn,
27+
"redundant closures, i.e. `|a| foo(a)` (which can be written as just `foo`)"
2728
}
2829

2930
impl LintPass for EtaPass {

clippy_lints/src/identity_op.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ use rustc_const_math::ConstInt;
1717
/// x / 1 + 0 * 1 - 0 | 0
1818
/// ```
1919
declare_lint! {
20-
pub IDENTITY_OP, Warn,
20+
pub IDENTITY_OP,
21+
Warn,
2122
"using identity operations, e.g. `x + 0` or `y / 1`"
2223
}
2324

clippy_lints/src/if_not_else.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ use utils::span_help_and_lint;
3131
/// }
3232
/// ```
3333
declare_lint! {
34-
pub IF_NOT_ELSE, Allow,
35-
"finds if branches that could be swapped so no negation operation is necessary on the condition"
34+
pub IF_NOT_ELSE,
35+
Allow,
36+
"`if` branches that could be swapped so no negation operation is necessary on the condition"
3637
}
3738

3839
pub struct IfNotElse;

clippy_lints/src/items_after_statements.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use utils::{in_macro, span_lint};
2929
declare_lint! {
3030
pub ITEMS_AFTER_STATEMENTS,
3131
Allow,
32-
"finds blocks where an item comes after a statement"
32+
"blocks where an item comes after a statement"
3333
}
3434

3535
pub struct ItemsAfterStatements;

clippy_lints/src/len_zero.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use utils::{get_item_name, in_macro, snippet, span_lint, span_lint_and_then, wal
2222
/// if x.len() == 0 { .. }
2323
/// ```
2424
declare_lint! {
25-
pub LEN_ZERO, Warn,
25+
pub LEN_ZERO,
26+
Warn,
2627
"checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` \
2728
could be used instead"
2829
}
@@ -45,7 +46,8 @@ declare_lint! {
4546
/// }
4647
/// ```
4748
declare_lint! {
48-
pub LEN_WITHOUT_IS_EMPTY, Warn,
49+
pub LEN_WITHOUT_IS_EMPTY,
50+
Warn,
4951
"traits and impls that have `.len()` but not `.is_empty()`"
5052
}
5153

clippy_lints/src/let_if_seq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use utils::{snippet, span_lint_and_then};
4545
declare_lint! {
4646
pub USELESS_LET_IF_SEQ,
4747
Warn,
48-
"Checks for unidiomatic `let mut` declaration followed by initialization in `if`"
48+
"unidiomatic `let mut` declaration followed by initialization in `if`"
4949
}
5050

5151
#[derive(Copy,Clone)]

clippy_lints/src/loops.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ declare_lint! {
145145
declare_lint! {
146146
pub WHILE_LET_LOOP,
147147
Warn,
148-
"`loop { if let { ... } else break }` can be written as a `while let` loop"
148+
"`loop { if let { ... } else break }`, which can be written as a `while let` loop"
149149
}
150150

151151
/// **What it does:** Checks for using `collect()` on an iterator without using
@@ -186,7 +186,7 @@ declare_lint! {
186186
declare_lint! {
187187
pub REVERSE_RANGE_LOOP,
188188
Warn,
189-
"Iterating over an empty range, such as `10..0` or `5..5`"
189+
"iteration over an empty range, such as `10..0` or `5..5`"
190190
}
191191

192192
/// **What it does:** Checks `for` loops over slices with an explicit counter
@@ -224,7 +224,7 @@ declare_lint! {
224224
declare_lint! {
225225
pub EMPTY_LOOP,
226226
Warn,
227-
"empty `loop {}` detected"
227+
"empty `loop {}`, which should block or sleep"
228228
}
229229

230230
/// **What it does:** Checks for `while let` expressions on iterators.

clippy_lints/src/map_clone.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ use utils::{is_adjusted, match_path, match_trait_method, match_type, paths, snip
1616
/// x.map(|e| e.clone());
1717
/// ```
1818
declare_lint! {
19-
pub MAP_CLONE, Warn,
20-
"using `.map(|x| x.clone())` to clone an iterator or option's contents (recommends \
21-
`.cloned()` instead)"
19+
pub MAP_CLONE,
20+
Warn,
21+
"using `.map(|x| x.clone())` to clone an iterator or option's contents"
2222
}
2323

2424
#[derive(Copy, Clone)]

0 commit comments

Comments
 (0)