diff --git a/tools/coding_standard/whitespace.py b/tools/coding_standard/whitespace.py index b0b809e521..80b7328ed3 100644 --- a/tools/coding_standard/whitespace.py +++ b/tools/coding_standard/whitespace.py @@ -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):