From 4b9cb857f9b6da4e3b274601a6c439aac8a2c425 Mon Sep 17 00:00:00 2001 From: blyxyas Date: Wed, 15 Mar 2023 23:18:25 +0100 Subject: [PATCH] Rename lint --- CHANGELOG.md | 2 +- .../src/{allow_attribute.rs => allow_attributes.rs} | 6 +++--- clippy_lints/src/declared_lints.rs | 2 +- clippy_lints/src/lib.rs | 4 ++-- tests/ui/{allow_attribute.fixed => allow_attributes.fixed} | 2 +- tests/ui/{allow_attribute.rs => allow_attributes.rs} | 2 +- .../ui/{allow_attribute.stderr => allow_attributes.stderr} | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) rename clippy_lints/src/{allow_attribute.rs => allow_attributes.rs} (95%) rename tests/ui/{allow_attribute.fixed => allow_attributes.fixed} (93%) rename tests/ui/{allow_attribute.rs => allow_attributes.rs} (93%) rename tests/ui/{allow_attribute.stderr => allow_attributes.stderr} (69%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b00fd962..c090a8448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4382,7 +4382,7 @@ Released 2018-09-13 [`absurd_extreme_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons [`alloc_instead_of_core`]: https://rust-lang.github.io/rust-clippy/master/index.html#alloc_instead_of_core -[`allow_attribute`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attribute +[`allow_attributes`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes [`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason [`almost_complete_letter_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_letter_range [`almost_complete_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_range diff --git a/clippy_lints/src/allow_attribute.rs b/clippy_lints/src/allow_attributes.rs similarity index 95% rename from clippy_lints/src/allow_attribute.rs rename to clippy_lints/src/allow_attributes.rs index 28fc45d05..3d660a11e 100644 --- a/clippy_lints/src/allow_attribute.rs +++ b/clippy_lints/src/allow_attributes.rs @@ -40,12 +40,12 @@ declare_clippy_lint! { /// } /// ``` #[clippy::version = "1.69.0"] - pub ALLOW_ATTRIBUTE, + pub ALLOW_ATTRIBUTES, restriction, "`#[allow]` will not trigger if a warning isn't found. `#[expect]` triggers if there are no warnings." } -declare_lint_pass!(AllowAttribute => [ALLOW_ATTRIBUTE]); +declare_lint_pass!(AllowAttribute => [ALLOW_ATTRIBUTES]); impl LateLintPass<'_> for AllowAttribute { // Separate each crate's features. @@ -58,7 +58,7 @@ impl LateLintPass<'_> for AllowAttribute { then { span_lint_and_sugg( cx, - ALLOW_ATTRIBUTE, + ALLOW_ATTRIBUTES, ident.span, "#[allow] attribute found", "replace it with", "expect".into() diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs index 73f74d59f..25f159734 100644 --- a/clippy_lints/src/declared_lints.rs +++ b/clippy_lints/src/declared_lints.rs @@ -35,7 +35,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[ crate::utils::internal_lints::produce_ice::PRODUCE_ICE_INFO, #[cfg(feature = "internal")] crate::utils::internal_lints::unnecessary_def_path::UNNECESSARY_DEF_PATH_INFO, - crate::allow_attribute::ALLOW_ATTRIBUTE_INFO, + crate::allow_attributes::ALLOW_ATTRIBUTES_INFO, crate::almost_complete_range::ALMOST_COMPLETE_RANGE_INFO, crate::approx_const::APPROX_CONSTANT_INFO, crate::as_conversions::AS_CONVERSIONS_INFO, diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index a3c65a69c..c455c3e30 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -67,7 +67,7 @@ mod declared_lints; mod renamed_lints; // begin lints modules, do not remove this comment, it’s used in `update_lints` -mod allow_attribute; +mod allow_attributes; mod almost_complete_range; mod approx_const; mod as_conversions; @@ -934,7 +934,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: store.register_late_pass(|_| Box::new(missing_assert_message::MissingAssertMessage)); store.register_early_pass(|| Box::new(redundant_async_block::RedundantAsyncBlock)); store.register_late_pass(|_| Box::new(let_with_type_underscore::UnderscoreTyped)); - store.register_late_pass(|_| Box::new(allow_attribute::AllowAttribute)); + store.register_late_pass(|_| Box::new(allow_attributes::AllowAttribute)); // add lints here, do not remove this comment, it's used in `new_lint` } diff --git a/tests/ui/allow_attribute.fixed b/tests/ui/allow_attributes.fixed similarity index 93% rename from tests/ui/allow_attribute.fixed rename to tests/ui/allow_attributes.fixed index 01759ced0..b8dd0619e 100644 --- a/tests/ui/allow_attribute.fixed +++ b/tests/ui/allow_attributes.fixed @@ -1,6 +1,6 @@ // run-rustfix #![allow(unused)] -#![warn(clippy::allow_attribute)] +#![warn(clippy::allow_attributes)] #![feature(lint_reasons)] fn main() {} diff --git a/tests/ui/allow_attribute.rs b/tests/ui/allow_attributes.rs similarity index 93% rename from tests/ui/allow_attribute.rs rename to tests/ui/allow_attributes.rs index b8e341fe9..295f56090 100644 --- a/tests/ui/allow_attribute.rs +++ b/tests/ui/allow_attributes.rs @@ -1,6 +1,6 @@ // run-rustfix #![allow(unused)] -#![warn(clippy::allow_attribute)] +#![warn(clippy::allow_attributes)] #![feature(lint_reasons)] fn main() {} diff --git a/tests/ui/allow_attribute.stderr b/tests/ui/allow_attributes.stderr similarity index 69% rename from tests/ui/allow_attribute.stderr rename to tests/ui/allow_attributes.stderr index 58b7323b0..681837e9e 100644 --- a/tests/ui/allow_attribute.stderr +++ b/tests/ui/allow_attributes.stderr @@ -1,13 +1,13 @@ error: #[allow] attribute found - --> $DIR/allow_attribute.rs:11:3 + --> $DIR/allow_attributes.rs:11:3 | LL | #[allow(dead_code)] | ^^^^^ help: replace it with: `expect` | - = note: `-D clippy::allow-attribute` implied by `-D warnings` + = note: `-D clippy::allow-attributes` implied by `-D warnings` error: #[allow] attribute found - --> $DIR/allow_attribute.rs:20:30 + --> $DIR/allow_attributes.rs:20:30 | LL | #[cfg_attr(panic = "unwind", allow(dead_code))] | ^^^^^ help: replace it with: `expect`