From 4436dec1d910dd6bc094e898603db7d4f9f4a89e Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 15 May 2024 22:25:20 -0400 Subject: [PATCH] Fix broken comment in `too-many-branches` (#11440) --- .../ruff_linter/src/rules/pylint/rules/too_many_branches.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_linter/src/rules/pylint/rules/too_many_branches.rs b/crates/ruff_linter/src/rules/pylint/rules/too_many_branches.rs index 43af2390a4..a102c1414e 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/too_many_branches.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/too_many_branches.rs @@ -181,8 +181,8 @@ fn num_branches(stmts: &[Stmt]) -> usize { .map(|case| num_branches(&case.body)) .sum::() } - Stmt::With(ast::StmtWith { body, .. }) => num_branches(body), // The `with` statement - // is not considered a branch but the statements inside the `with` should be counted + // The `with` statement is not considered a branch but the statements inside the `with` should be counted. + Stmt::With(ast::StmtWith { body, .. }) => num_branches(body), Stmt::For(ast::StmtFor { body, orelse, .. }) | Stmt::While(ast::StmtWhile { body, orelse, .. }) => { 1 + num_branches(body)