summaryrefslogtreecommitdiff
path: root/run_clang_tidy.py
blob: 40d4a5e7d67d1578df91feff5bf43431a56a1461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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"])