diff --git a/crates/ruff_linter/src/checkers/logical_lines.rs b/crates/ruff_linter/src/checkers/logical_lines.rs index e765e8cf42171..4044e6c18a67b 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, }