Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn disallowed_methods and disallowed_types by default #8261

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clippy_lints/src/disallowed_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ declare_clippy_lint! {
/// ### What it does
/// Denies the configured methods and functions in clippy.toml
///
/// Note: Even though this lint is warn-by-default, it will only trigger if
/// methods are defined in the clippy.toml file.
///
/// ### Why is this bad?
/// Some methods are undesirable in certain contexts, and it's beneficial to
/// lint for them as needed.
Expand Down Expand Up @@ -49,7 +52,7 @@ declare_clippy_lint! {
/// ```
#[clippy::version = "1.49.0"]
pub DISALLOWED_METHODS,
nursery,
style,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if style is the right group (I felt like it is "user-defined code styles"), but I couldn't find another group that looked good. (restriction that #7841 originally proposed is allowed by default.)

"use of a disallowed method call"
}

Expand Down
5 changes: 4 additions & 1 deletion clippy_lints/src/disallowed_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ declare_clippy_lint! {
/// ### What it does
/// Denies the configured types in clippy.toml.
///
/// Note: Even though this lint is warn-by-default, it will only trigger if
/// types are defined in the clippy.toml file.
///
/// ### Why is this bad?
/// Some types are undesirable in certain contexts.
///
Expand Down Expand Up @@ -44,7 +47,7 @@ declare_clippy_lint! {
/// ```
#[clippy::version = "1.55.0"]
pub DISALLOWED_TYPES,
nursery,
style,
"use of disallowed types"
}
#[derive(Clone, Debug)]
Expand Down
2 changes: 2 additions & 0 deletions clippy_lints/src/lib.register_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
LintId::of(derivable_impls::DERIVABLE_IMPLS),
LintId::of(derive::DERIVE_HASH_XOR_EQ),
LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD),
LintId::of(disallowed_methods::DISALLOWED_METHODS),
LintId::of(disallowed_types::DISALLOWED_TYPES),
LintId::of(doc::MISSING_SAFETY_DOC),
LintId::of(doc::NEEDLESS_DOCTEST_MAIN),
LintId::of(double_comparison::DOUBLE_COMPARISONS),
Expand Down
2 changes: 0 additions & 2 deletions clippy_lints/src/lib.register_nursery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
LintId::of(attrs::EMPTY_LINE_AFTER_OUTER_ATTR),
LintId::of(cognitive_complexity::COGNITIVE_COMPLEXITY),
LintId::of(copies::BRANCHES_SHARING_CODE),
LintId::of(disallowed_methods::DISALLOWED_METHODS),
LintId::of(disallowed_types::DISALLOWED_TYPES),
LintId::of(equatable_if_let::EQUATABLE_IF_LET),
LintId::of(fallible_impl_from::FALLIBLE_IMPL_FROM),
LintId::of(floating_point_arithmetic::IMPRECISE_FLOPS),
Expand Down
2 changes: 2 additions & 0 deletions clippy_lints/src/lib.register_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
LintId::of(comparison_chain::COMPARISON_CHAIN),
LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT),
LintId::of(dereference::NEEDLESS_BORROW),
LintId::of(disallowed_methods::DISALLOWED_METHODS),
LintId::of(disallowed_types::DISALLOWED_TYPES),
LintId::of(doc::MISSING_SAFETY_DOC),
LintId::of(doc::NEEDLESS_DOCTEST_MAIN),
LintId::of(enum_variants::ENUM_VARIANT_NAMES),
Expand Down