forked from SFTtech/openage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clang-tidy to buildsystem checks
Fixes SFTtech#1060
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2015-2018 the openage authors. See copying.md for legal info. | ||
|
||
import subprocess | ||
|
||
from .cppstyle import filter_file_list | ||
from .util import findfiles | ||
|
||
|
||
def find_issues(check_files, dirnames): | ||
""" Invokes the external clang-tidy tool. """ | ||
|
||
invocation = ['clang-tidy', '-checks=-*,readability-*'] | ||
|
||
if check_files is not None: | ||
filenames = filter_file_list(check_files, dirnames) | ||
else: | ||
filenames = filter_file_list(findfiles(dirnames), dirnames) | ||
|
||
invocation.extend(filenames) | ||
|
||
try: | ||
retcode = subprocess.check_call(invocation) | ||
except subprocess.CalledProcessError as exc: | ||
retcode = exc.returncode | ||
|
||
if retcode: | ||
yield ("clang-tidy issue", f"clang-tidy exited with return code {retcode}", None) |