diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-06-08 15:57:01 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-06-08 18:42:01 -0400 |
commit | 8e9a032204dd891b47dc552b0ce90c5c57c2d744 (patch) | |
tree | 19129ebb3ff41bbb0fe7cf02ae3ccfbdb4086060 | |
parent | ab4072ea2af7f28d7ed39b78b3e0c59e5928e9ea (diff) | |
download | mongo-8e9a032204dd891b47dc552b0ce90c5c57c2d744.tar.gz |
SERVER-24355 clang_format leaves temporary files around after a reformat
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | buildscripts/clang_format.py | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore index 193924cf5f8..1a653506fe7 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ *.gch *.*sdf *.psess +*.tmp *# .#* diff --git a/buildscripts/clang_format.py b/buildscripts/clang_format.py index bc38c341048..850832d1563 100755 --- a/buildscripts/clang_format.py +++ b/buildscripts/clang_format.py @@ -309,7 +309,16 @@ class ClangFormat(object): return True # Update the file with clang-format - return not subprocess.call([self.path, "--style=file", "-i", file_name]) + formatted = not subprocess.call([self.path, "--style=file", "-i", file_name]) + + # Version 3.8 generates files like foo.cpp~RF83372177.TMP when it formats foo.cpp + # on Windows, we must clean these up + if sys.platform == "win32": + glob_pattern = file_name + "*.TMP" + for fglob in glob.glob(glob_pattern): + os.unlink(fglob) + + return formatted def parallel_process(items, func): |