[Bf-blender-cvs] [cc596855b36] temp-clang-format: Add test/gtest ignore BLI headers that fail badly to format

Campbell Barton noreply at git.blender.org
Fri Jan 11 00:39:41 CET 2019


Commit: cc596855b3699b9ed31de1df03f851e476907b25
Author: Campbell Barton
Date:   Fri Jan 11 10:02:16 2019 +1100
Branches: temp-clang-format
https://developer.blender.org/rBcc596855b3699b9ed31de1df03f851e476907b25

Add test/gtest ignore BLI headers that fail badly to format

===================================================================

M	clang-format-paths.py

===================================================================

diff --git a/clang-format-paths.py b/clang-format-paths.py
index e6147866f85..2efffdbb6cc 100755
--- a/clang-format-paths.py
+++ b/clang-format-paths.py
@@ -30,6 +30,7 @@ if not paths:
         "intern/string",
         "intern/utfconv",
         "source",
+        "tests/gtests",
     ))
 
 if os.sep != "/":
@@ -42,9 +43,16 @@ extensions = (
     ".osl", ".glsl",
 )
 
-ignore_files = (
-    "sobol.cpp",  # Too heavy for clang-format
-)
+ignore_files = {
+    "intern/cycles/render/sobol.cpp",  # Too heavy for clang-format
+
+    # could use clang-format on/off
+    "source/blender/blenlib/BLI_compiler_typecheck.h",    # Over wraps args.
+    "source/blender/blenlib/BLI_utildefines_variadic.h",  # Over wraps args.
+    "tests/gtests/blenlib/BLI_ressource_strings.h",       # Large data file, not helpful to format.
+}
+if os.sep != "/":
+    ignore_files = set(f.replace("/", os.sep) for f in ignore_files)
 
 print("Operating on:")
 for p in paths:
@@ -94,7 +102,8 @@ def main():
 
     files = [
         f for f in source_files_from_git()
-        if f.endswith(extensions) and os.path.basename(f) not in ignore_files
+        if f.endswith(extensions)
+        if f not in ignore_files
     ]
 
     convert_tabs_to_spaces(files)



More information about the Bf-blender-cvs mailing list