Skip to content
Snippets Groups Projects
Commit 3b7f58fb authored by Campbell Barton's avatar Campbell Barton
Browse files

clang_format_paths: expand tabs for cmake too

parent bdd05100
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,11 @@ extensions = ( ...@@ -16,6 +16,11 @@ extensions = (
".osl", ".glsl", ".osl", ".glsl",
) )
extensions_cmake = (
".cmake",
"CMakeLists.txt",
)
ignore_files = { ignore_files = {
"intern/cycles/render/sobol.cpp", # Too heavy for clang-format "intern/cycles/render/sobol.cpp", # Too heavy for clang-format
} }
...@@ -152,6 +157,8 @@ def main(): ...@@ -152,6 +157,8 @@ def main():
args = argparse_create().parse_args() args = argparse_create().parse_args()
use_default_paths = bool(args.paths)
paths = compute_paths(args.paths) paths = compute_paths(args.paths)
print("Operating on:") print("Operating on:")
for p in paths: for p in paths:
...@@ -163,8 +170,15 @@ def main(): ...@@ -163,8 +170,15 @@ def main():
if f not in ignore_files if f not in ignore_files
] ]
# Always operate on all cmake files (when expanding tabs and no paths given).
files_cmake = [
f for f in source_files_from_git("." if use_default_paths else paths)
if f.endswith(extensions_cmake)
if f not in ignore_files
]
if args.expand_tabs: if args.expand_tabs:
convert_tabs_to_spaces(files) convert_tabs_to_spaces(files + files_cmake)
clang_format(files) clang_format(files)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment