Skip to content

Commit 5a76b38

Browse files
committed
style: Remove mixed-whitespace skip to convert all leading spaces to tabs
1 parent d5b0b33 commit 5a76b38

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

scripts/cpp/convert_leading_spaces_to_tabs.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,8 @@ def process_file(filepath, dry_run=False, verbose=False):
174174
new_lines.append(line)
175175
continue
176176

177-
# Skip mixed tab+space lines (e.g. tab then spaces for alignment)
178-
# These need careful handling deferred to a later PR
179-
if '\t' in leading_ws and ' ' in leading_ws:
180-
new_lines.append(line)
181-
skipped += 1
182-
if verbose:
183-
print(f" SKIP mixed L{line_idx+1}: {line.rstrip()[:80]}")
184-
continue
185-
186-
# This line has leading spaces. Use tree-sitter to determine depth.
177+
# This line has spaces in its leading whitespace (possibly mixed with tabs).
178+
# Use tree-sitter to determine the correct depth.
187179
# Find the AST node at the first non-whitespace character.
188180
col = len(leading_ws)
189181
node = tree.root_node.descendant_for_point_range(

0 commit comments

Comments
 (0)