Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ament_clang_tidy/ament_clang_tidy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ def main(argv=sys.argv[1:]):
type=int,
default=1,
help='number of clang-tidy jobs to run in parallel')
parser.add_argument(
'--extra-arg',
type=str,
action='append',
dest='extra_arg',
default=None,
help='Additional argument to append to the compiler command line')

# not using a file handle directly
# in order to prevent leaving an empty file when something fails early
Expand Down Expand Up @@ -152,6 +159,9 @@ def invoke_clang_tidy(compilation_db_path):
cmd.append('--quiet')
if args.system_headers:
cmd.append('--system-headers')
if args.extra_arg:
for arg in args.extra_arg:
cmd.append('--extra-arg=' + arg)

def is_gtest_source(file_name):
if file_name == 'gtest_main.cc' or file_name == 'gtest-all.cc' \
Expand Down Expand Up @@ -264,6 +274,9 @@ def start_subprocess(full_cmd):
with open(args.xunit_file, 'w') as f:
f.write(xml)

if output:
sys.exit(1)


def find_executable(file_names):
paths = os.getenv('PATH').split(os.path.pathsep)
Expand Down