From e2fe177c6b4e867d59409c809781a7d6922e778a Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 8 May 2024 21:51:37 -0400 Subject: [PATCH] Revert "Simplify arithmetic operation in logical lines checker (#11346)" (#11348) ## Summary I merged this, but I think it might not be the same behavior? See my comment at: https://github.com/astral-sh/ruff/pull/11346#discussion_r1594848224 --- crates/ruff_linter/src/checkers/logical_lines.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/checkers/logical_lines.rs b/crates/ruff_linter/src/checkers/logical_lines.rs index e765e8cf421711..4044e6c18a67b3 100644 --- a/crates/ruff_linter/src/checkers/logical_lines.rs +++ b/crates/ruff_linter/src/checkers/logical_lines.rs @@ -24,7 +24,7 @@ pub(crate) fn expand_indent(line: &str, indent_width: IndentWidth) -> usize { let tab_size = indent_width.as_usize(); for c in line.bytes() { match c { - b'\t' => indent += tab_size, + b'\t' => indent = (indent / tab_size) * tab_size + tab_size, b' ' => indent += 1, _ => break, }