Keep file permissions while fixing whitespace issues

This commit is contained in:
Richard Berger
2020-06-16 07:19:19 -04:00
parent 943d252403
commit 95e79b2347

View File

@ -74,6 +74,7 @@ def fix_file(path, check_result):
with open(path, 'r', encoding=check_result['encoding']) as src:
for line in src:
print(line.rstrip(), file=out)
shutil.copymode(path, newfile)
shutil.move(newfile, path)
def check_folder(directory, config, fix=False, verbose=False):