Mention an extra argument needed to check tests (#16205)

Add a note for tests-related lints that clippy needs to be run with
`--tests` argument to actually check tests.

changelog: [`ignore_without_reason`, `redundant_test_prefix`]: Mention
an extra `clippy` argument needed to check tests

Fixes rust-lang/rust-clippy#16111
This commit is contained in:
Samuel Tardieu 2026-01-12 16:42:12 +00:00 committed by GitHub
commit d9d034ce4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -468,6 +468,10 @@ declare_clippy_lint! {
/// #[ignore = "Some good reason"]
/// fn test() {}
/// ```
///
/// ### Note
/// Clippy can only lint compiled code. For this lint to trigger, you must configure `cargo clippy`
/// to include test compilation, for instance, by using flags such as `--tests` or `--all-targets`.
#[clippy::version = "1.88.0"]
pub IGNORE_WITHOUT_REASON,
pedantic,

View file

@ -47,6 +47,10 @@ declare_clippy_lint! {
/// }
/// }
/// ```
///
/// ### Note
/// Clippy can only lint compiled code. For this lint to trigger, you must configure `cargo clippy`
/// to include test compilation, for instance, by using flags such as `--tests` or `--all-targets`.
#[clippy::version = "1.88.0"]
pub REDUNDANT_TEST_PREFIX,
restriction,