diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs index 4879f1e93d0691..e2fcc4d77a1ba8 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs @@ -696,9 +696,7 @@ impl<'a> BlankLinesChecker<'a> { state.class_status.update(&logical_line); state.fn_status.update(&logical_line); - if state.is_not_first_logical_line { - self.check_line(&logical_line, &state, prev_indent_length, diagnostics); - } + self.check_line(&logical_line, &state, prev_indent_length, diagnostics); match logical_line.kind { LogicalLineKind::Class => { @@ -733,8 +731,6 @@ impl<'a> BlankLinesChecker<'a> { } if !logical_line.is_comment_only { - state.is_not_first_logical_line = true; - state.last_non_comment_line_end = logical_line.logical_line_end; if logical_line.indent_length == 0 { @@ -994,8 +990,6 @@ struct BlankLinesState { follows: Follows, fn_status: Status, class_status: Status, - /// First line that is not a comment. - is_not_first_logical_line: bool, /// Used for the fix in case a comment separates two non-comment logical lines to make the comment "stick" /// to the second line instead of the first. last_non_comment_line_end: TextSize,