Change category and update to ui_test

This commit is contained in:
Catherine 2023-06-27 05:25:54 -05:00
parent 8296a338db
commit 46aa8abf08
7 changed files with 15 additions and 11 deletions

View File

@ -23,16 +23,18 @@ declare_clippy_lint! {
/// ``` /// ```
#[clippy::version = "1.72.0"] #[clippy::version = "1.72.0"]
pub NEEDLESS_PUB_SELF, pub NEEDLESS_PUB_SELF,
complexity, style,
"checks for usage of `pub(self)` and `pub(in self)`." "checks for usage of `pub(self)` and `pub(in self)`."
} }
declare_clippy_lint! { declare_clippy_lint! {
/// ### What it does /// ### What it does
/// Checks for missing usage of the `pub(in <loc>)` shorthand. /// Checks for usage of `pub(<loc>)` with `in`.
/// ///
/// ### Why is this bad? /// ### Why is this bad?
/// Consistency. Use it or don't, just be consistent about it. /// Consistency. Use it or don't, just be consistent about it.
/// ///
/// Also see the `pub_without_shorthand` lint for an alternative.
///
/// ### Example /// ### Example
/// ```rust,ignore /// ```rust,ignore
/// pub(super) type OptBox<T> = Option<Box<T>>; /// pub(super) type OptBox<T> = Option<Box<T>>;
@ -44,11 +46,11 @@ declare_clippy_lint! {
#[clippy::version = "1.72.0"] #[clippy::version = "1.72.0"]
pub PUB_WITH_SHORTHAND, pub PUB_WITH_SHORTHAND,
restriction, restriction,
"disallows usage of the `pub(<loc>)`, suggesting use of the `in` shorthand" "disallows usage of `pub(<loc>)`, without `in`"
} }
declare_clippy_lint! { declare_clippy_lint! {
/// ### What it does /// ### What it does
/// Checks for usage of the `pub(in <loc>)` shorthand. /// Checks for usage of `pub(<loc>)` without `in`.
/// ///
/// Note: As you cannot write a module's path in `pub(<loc>)`, this will only trigger on /// Note: As you cannot write a module's path in `pub(<loc>)`, this will only trigger on
/// `pub(super)` and the like. /// `pub(super)` and the like.
@ -56,6 +58,8 @@ declare_clippy_lint! {
/// ### Why is this bad? /// ### Why is this bad?
/// Consistency. Use it or don't, just be consistent about it. /// Consistency. Use it or don't, just be consistent about it.
/// ///
/// Also see the `pub_with_shorthand` lint for an alternative.
///
/// ### Example /// ### Example
/// ```rust,ignore /// ```rust,ignore
/// pub(in super) type OptBox<T> = Option<Box<T>>; /// pub(in super) type OptBox<T> = Option<Box<T>>;
@ -67,7 +71,7 @@ declare_clippy_lint! {
#[clippy::version = "1.72.0"] #[clippy::version = "1.72.0"]
pub PUB_WITHOUT_SHORTHAND, pub PUB_WITHOUT_SHORTHAND,
restriction, restriction,
"disallows usage of the `pub(in <loc>)` shorthand wherever possible" "disallows usage of `pub(in <loc>)` with `in`"
} }
declare_lint_pass!(Visibility => [NEEDLESS_PUB_SELF, PUB_WITH_SHORTHAND, PUB_WITHOUT_SHORTHAND]); declare_lint_pass!(Visibility => [NEEDLESS_PUB_SELF, PUB_WITH_SHORTHAND, PUB_WITHOUT_SHORTHAND]);

View File

@ -1,5 +1,5 @@
//@run-rustfix //@run-rustfix
//@aux-build:proc_macros.rs //@aux-build:proc_macros.rs:proc-macro
#![feature(custom_inner_attributes)] #![feature(custom_inner_attributes)]
#![allow(unused)] #![allow(unused)]
#![warn(clippy::needless_pub_self)] #![warn(clippy::needless_pub_self)]

View File

@ -1,5 +1,5 @@
//@run-rustfix //@run-rustfix
//@aux-build:proc_macros.rs //@aux-build:proc_macros.rs:proc-macro
#![feature(custom_inner_attributes)] #![feature(custom_inner_attributes)]
#![allow(unused)] #![allow(unused)]
#![warn(clippy::needless_pub_self)] #![warn(clippy::needless_pub_self)]

View File

@ -1,5 +1,5 @@
//@run-rustfix //@run-rustfix
//@aux-build:proc_macros.rs //@aux-build:proc_macros.rs:proc-macro
#![feature(custom_inner_attributes)] #![feature(custom_inner_attributes)]
#![allow(clippy::needless_pub_self, unused)] #![allow(clippy::needless_pub_self, unused)]
#![warn(clippy::pub_with_shorthand)] #![warn(clippy::pub_with_shorthand)]

View File

@ -1,5 +1,5 @@
//@run-rustfix //@run-rustfix
//@aux-build:proc_macros.rs //@aux-build:proc_macros.rs:proc-macro
#![feature(custom_inner_attributes)] #![feature(custom_inner_attributes)]
#![allow(clippy::needless_pub_self, unused)] #![allow(clippy::needless_pub_self, unused)]
#![warn(clippy::pub_with_shorthand)] #![warn(clippy::pub_with_shorthand)]

View File

@ -1,5 +1,5 @@
//@run-rustfix //@run-rustfix
//@aux-build:proc_macros.rs //@aux-build:proc_macros.rs:proc-macro
#![feature(custom_inner_attributes)] #![feature(custom_inner_attributes)]
#![allow(clippy::needless_pub_self, unused)] #![allow(clippy::needless_pub_self, unused)]
#![warn(clippy::pub_without_shorthand)] #![warn(clippy::pub_without_shorthand)]

View File

@ -1,5 +1,5 @@
//@run-rustfix //@run-rustfix
//@aux-build:proc_macros.rs //@aux-build:proc_macros.rs:proc-macro
#![feature(custom_inner_attributes)] #![feature(custom_inner_attributes)]
#![allow(clippy::needless_pub_self, unused)] #![allow(clippy::needless_pub_self, unused)]
#![warn(clippy::pub_without_shorthand)] #![warn(clippy::pub_without_shorthand)]