From e7eced3c87310b15ac20cc3cd470d67686104a14 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 1 May 2024 07:58:22 +0300 Subject: #824 Don't fix tabs in files with no tabs --- scripts/code_tools/fix_whitespace.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/code_tools/fix_whitespace.py b/scripts/code_tools/fix_whitespace.py index 37e15c6d10..91e82f26f4 100644 --- a/scripts/code_tools/fix_whitespace.py +++ b/scripts/code_tools/fix_whitespace.py @@ -33,6 +33,10 @@ def convert_tabs_to_spaces(file_path, tab_stop): with open(file_path, 'r') as file: lines = file.readlines() + # Skip files with no tabs + if not any('\t' in line for line in lines): + return + new_lines = [] for line in lines: # Remove trailing spaces -- cgit v1.2.3