build: specific line with trailing whitespace (#20155)
This commit is contained in:
parent
d84e2e3972
commit
a9f2a52ce0
1 changed files with 2 additions and 2 deletions
|
@ -46,10 +46,10 @@ def hasTrailingWhiteSpace(filepath, fix):
|
|||
f.close()
|
||||
|
||||
fixed_lines = []
|
||||
for line in lines:
|
||||
for num, line in enumerate(lines):
|
||||
fixed_lines.append(line.rstrip() + '\n')
|
||||
if not fix and line != line.rstrip():
|
||||
print("Trailing whitespace in: " + filepath)
|
||||
print("Trailing whitespace on line {} in file: {}".format(num + 1, filepath))
|
||||
return True
|
||||
if fix:
|
||||
with open(filepath, 'w') as f:
|
||||
|
|
Loading…
Reference in a new issue