Skip to content

Commit

Permalink
feat: allow to pass multiple extra-arg arguments to clang-tidy
Browse files Browse the repository at this point in the history
Signed-off-by: WU MENGHUNG <[email protected]>
  • Loading branch information
wuisky committed Feb 7, 2024
1 parent c756cdc commit 6959c91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ament_clang_tidy/ament_clang_tidy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def main(argv=sys.argv[1:]):
parser.add_argument(
'--extra-arg',
type=str,
action='append',
dest='extra_arg',
default=None,
help='Additional argument to append to the compiler command line')

Expand Down Expand Up @@ -158,7 +160,8 @@ def invoke_clang_tidy(compilation_db_path):
if args.system_headers:
cmd.append('--system-headers')
if args.extra_arg:
cmd.append('--extra-arg=' + 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

0 comments on commit 6959c91

Please sign in to comment.