From 37772b81cf05b3969d983eebfce6713c8dca7bbd Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Mon, 8 Dec 2025 18:22:33 +0300 Subject: [PATCH] Mention an extra argument required to check tests Add a note to tests-related lint descriptions that clippy needs to be run with `--tests` argument to actually check tests, which is not quite obvious. --- clippy_lints/src/attrs/mod.rs | 2 ++ clippy_lints/src/redundant_test_prefix.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/clippy_lints/src/attrs/mod.rs b/clippy_lints/src/attrs/mod.rs index 91c2dc7f3dc6..b2c4246fe266 100644 --- a/clippy_lints/src/attrs/mod.rs +++ b/clippy_lints/src/attrs/mod.rs @@ -453,6 +453,8 @@ declare_clippy_lint! { /// ### What it does /// Checks for ignored tests without messages. /// + /// Note: you need to run `cargo clippy --tests` to enable tests checking. + /// /// ### Why is this bad? /// The reason for ignoring the test may not be obvious. /// diff --git a/clippy_lints/src/redundant_test_prefix.rs b/clippy_lints/src/redundant_test_prefix.rs index 84276e321657..63c3ce10a876 100644 --- a/clippy_lints/src/redundant_test_prefix.rs +++ b/clippy_lints/src/redundant_test_prefix.rs @@ -17,6 +17,8 @@ declare_clippy_lint! { /// Checks for test functions (functions annotated with `#[test]`) that are prefixed /// with `test_` which is redundant. /// + /// Note: you need to run `cargo clippy --tests` to enable tests checking. + /// /// ### Why is this bad? /// This is redundant because test functions are already annotated with `#[test]`. /// Moreover, it clutters the output of `cargo test` since test functions are expanded as