From 95e79b23479c8ffb5ecb5dbe744465d0b2cf984f Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 16 Jun 2020 07:19:19 -0400 Subject: [PATCH] Keep file permissions while fixing whitespace issues --- tools/coding_standard/whitespace.py | 1 + 1 file changed, 1 insertion(+) 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):