diff options
Diffstat (limited to 'mesonbuild/scripts/clangtidy.py')
-rw-r--r-- | mesonbuild/scripts/clangtidy.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/scripts/clangtidy.py b/mesonbuild/scripts/clangtidy.py index 0452086..11174ea 100644 --- a/mesonbuild/scripts/clangtidy.py +++ b/mesonbuild/scripts/clangtidy.py @@ -16,10 +16,11 @@ import pathlib import subprocess import shutil from concurrent.futures import ThreadPoolExecutor +import typing as T from ..compilers import lang_suffixes -def manual_clangformat(srcdir_name, builddir_name): +def manual_clangformat(srcdir_name: str, builddir_name: str) -> int: srcdir = pathlib.Path(srcdir_name) suffixes = set(lang_suffixes['c']).union(set(lang_suffixes['cpp'])) suffixes.add('h') @@ -34,7 +35,7 @@ def manual_clangformat(srcdir_name, builddir_name): [max(returncode, x.result().returncode) for x in futures] return returncode -def clangformat(srcdir_name, builddir_name): +def clangformat(srcdir_name: str, builddir_name: str) -> int: run_clang_tidy = None for rct in ('run-clang-tidy', 'run-clang-tidy.py'): if shutil.which(rct): @@ -45,8 +46,9 @@ def clangformat(srcdir_name, builddir_name): else: print('Could not find run-clang-tidy, running checks manually.') manual_clangformat(srcdir_name, builddir_name) + return 0 -def run(args): +def run(args: T.List[str]) -> int: srcdir_name = args[0] builddir_name = args[1] return clangformat(srcdir_name, builddir_name) |