#824 Don't fix tabs in files with no tabs

master
Andrey Lihatskiy 2024-05-01 07:58:22 +03:00
parent d48497268e
commit e7eced3c87
1 changed files with 4 additions and 0 deletions

View File

@ -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