|
|
@ -25,6 +25,7 @@ def clangformat(exelist: T.List[str], srcdir_name: str, builddir_name: str) -> i |
|
|
|
suffixes = set(lang_suffixes['c']).union(set(lang_suffixes['cpp'])) |
|
|
|
suffixes = set(lang_suffixes['c']).union(set(lang_suffixes['cpp'])) |
|
|
|
suffixes.add('h') |
|
|
|
suffixes.add('h') |
|
|
|
futures = [] |
|
|
|
futures = [] |
|
|
|
|
|
|
|
returncode = 0 |
|
|
|
with ThreadPoolExecutor() as e: |
|
|
|
with ThreadPoolExecutor() as e: |
|
|
|
for f in (x for suff in suffixes for x in srcdir.glob('**/*.' + suff)): |
|
|
|
for f in (x for suff in suffixes for x in srcdir.glob('**/*.' + suff)): |
|
|
|
if f.is_dir(): |
|
|
|
if f.is_dir(): |
|
|
@ -32,9 +33,9 @@ def clangformat(exelist: T.List[str], srcdir_name: str, builddir_name: str) -> i |
|
|
|
strf = str(f) |
|
|
|
strf = str(f) |
|
|
|
if strf.startswith(builddir_name): |
|
|
|
if strf.startswith(builddir_name): |
|
|
|
continue |
|
|
|
continue |
|
|
|
futures.append(e.submit(subprocess.check_call, exelist + ['-style=file', '-i', strf])) |
|
|
|
futures.append(e.submit(subprocess.run, exelist + ['-style=file', '-i', strf])) |
|
|
|
[x.result() for x in futures] |
|
|
|
returncode = max([x.result().returncode for x in futures]) |
|
|
|
return 0 |
|
|
|
return returncode |
|
|
|
|
|
|
|
|
|
|
|
def run(args: T.List[str]) -> int: |
|
|
|
def run(args: T.List[str]) -> int: |
|
|
|
srcdir_name = args[0] |
|
|
|
srcdir_name = args[0] |
|
|
|