summaryrefslogtreecommitdiff
path: root/run_clang_tidy.py
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-03-24 23:49:26 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-03-24 23:49:26 +0100
commit00c0d78199fcfbbb20828be5e06fd2d271fa4c1e (patch)
treee74aa52990af33f7bf1e4d452b464c3e24d1017e /run_clang_tidy.py
Initial commit
Diffstat (limited to 'run_clang_tidy.py')
-rw-r--r--run_clang_tidy.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/run_clang_tidy.py b/run_clang_tidy.py
new file mode 100644
index 0000000..40d4a5e
--- /dev/null
+++ b/run_clang_tidy.py
@@ -0,0 +1,17 @@
+import pathlib
+import subprocess
+
+def is_file(path):
+ return path.is_file()
+
+def has_extension(extensions):
+ def f(path):
+ return path.suffix in extensions
+ return f
+
+ROOTS = ["./deimos", "./game"]
+
+for root in ROOTS:
+ for file in filter(has_extension([".cpp", ".c"]), filter(is_file, pathlib.Path(root).rglob("*"))):
+ subprocess.run(["clang-tidy", file, "-header-filter=deimos|game"])
+