Skip to content

Commit 2fe98cc

Browse files
committed
Move cognitive_complexity to nursery
1 parent 7907abe commit 2fe98cc

23 files changed

+48
-58
lines changed

clippy_lints/src/assign_ops.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
7777
},
7878
hir::ExprKind::Assign(assignee, e, _) => {
7979
if let hir::ExprKind::Binary(op, l, r) = &e.kind {
80-
#[allow(clippy::cognitive_complexity)]
8180
let lint = |assignee: &hir::Expr<'_>, rhs: &hir::Expr<'_>| {
8281
let ty = cx.tables.expr_ty(assignee);
8382
let rty = cx.tables.expr_ty(rhs);

clippy_lints/src/cognitive_complexity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ declare_clippy_lint! {
2222
///
2323
/// **Example:** No. You'll see it when you get the warning.
2424
pub COGNITIVE_COMPLEXITY,
25-
complexity,
25+
nursery,
2626
"functions that should be split up into multiple functions"
2727
}
2828

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11621162
LintId::of(&booleans::LOGIC_BUG),
11631163
LintId::of(&booleans::NONMINIMAL_BOOL),
11641164
LintId::of(&bytecount::NAIVE_BYTECOUNT),
1165-
LintId::of(&cognitive_complexity::COGNITIVE_COMPLEXITY),
11661165
LintId::of(&collapsible_if::COLLAPSIBLE_IF),
11671166
LintId::of(&comparison_chain::COMPARISON_CHAIN),
11681167
LintId::of(&copies::IFS_SAME_COND),
@@ -1503,7 +1502,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15031502
LintId::of(&assign_ops::MISREFACTORED_ASSIGN_OP),
15041503
LintId::of(&attrs::DEPRECATED_CFG_ATTR),
15051504
LintId::of(&booleans::NONMINIMAL_BOOL),
1506-
LintId::of(&cognitive_complexity::COGNITIVE_COMPLEXITY),
15071505
LintId::of(&double_comparison::DOUBLE_COMPARISONS),
15081506
LintId::of(&double_parens::DOUBLE_PARENS),
15091507
LintId::of(&duration_subsec::DURATION_SUBSEC),
@@ -1674,6 +1672,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
16741672

16751673
store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
16761674
LintId::of(&attrs::EMPTY_LINE_AFTER_OUTER_ATTR),
1675+
LintId::of(&cognitive_complexity::COGNITIVE_COMPLEXITY),
16771676
LintId::of(&fallible_impl_from::FALLIBLE_IMPL_FROM),
16781677
LintId::of(&floating_point_arithmetic::IMPRECISE_FLOPS),
16791678
LintId::of(&floating_point_arithmetic::SUBOPTIMAL_FLOPS),

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ declare_lint_pass!(Methods => [
12891289
]);
12901290

12911291
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
1292-
#[allow(clippy::cognitive_complexity, clippy::too_many_lines)]
1292+
#[allow(clippy::too_many_lines)]
12931293
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr<'_>) {
12941294
if in_macro(expr.span) {
12951295
return;

clippy_lints/src/mutable_debug_assertion.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DebugAssertWithMutCall {
5353
}
5454

5555
//HACK(hellow554): remove this when #4694 is implemented
56-
#[allow(clippy::cognitive_complexity)]
5756
fn extract_call<'a, 'tcx>(cx: &'a LateContext<'a, 'tcx>, e: &'tcx Expr<'_>) -> Option<Span> {
5857
if_chain! {
5958
if let ExprKind::Block(ref block, _) = e.kind;

clippy_lints/src/types.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ impl Types {
315315
/// The parameter `is_local` distinguishes the context of the type; types from
316316
/// local bindings should only be checked for the `BORROWED_BOX` lint.
317317
#[allow(clippy::too_many_lines)]
318-
#[allow(clippy::cognitive_complexity)]
319318
fn check_ty(&mut self, cx: &LateContext<'_, '_>, hir_ty: &hir::Ty<'_>, is_local: bool) {
320319
if hir_ty.span.from_expansion() {
321320
return;

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
250250
},
251251
Lint {
252252
name: "cognitive_complexity",
253-
group: "complexity",
253+
group: "nursery",
254254
desc: "functions that should be split up into multiple functions",
255255
deprecation: None,
256256
module: "cognitive_complexity",

tests/ui/collapsible_else_if.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![allow(clippy::cognitive_complexity, clippy::assertions_on_constants)]
2+
#![allow(clippy::assertions_on_constants)]
33

44
#[rustfmt::skip]
55
#[warn(clippy::collapsible_if)]

tests/ui/collapsible_else_if.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![allow(clippy::cognitive_complexity, clippy::assertions_on_constants)]
2+
#![allow(clippy::assertions_on_constants)]
33

44
#[rustfmt::skip]
55
#[warn(clippy::collapsible_if)]

tests/ui/collapsible_if.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![allow(clippy::cognitive_complexity, clippy::assertions_on_constants)]
2+
#![allow(clippy::assertions_on_constants)]
33

44
#[rustfmt::skip]
55
#[warn(clippy::collapsible_if)]

0 commit comments

Comments
 (0)