Skip to content

Commit a3e92af

Browse files
committed
feat: allow to pass multiple extra-arg arguments to clang-tidy
1 parent 64a32c4 commit a3e92af

File tree

1 file changed

+4
-1
lines changed
  • ament_clang_tidy/ament_clang_tidy

1 file changed

+4
-1
lines changed

ament_clang_tidy/ament_clang_tidy/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def main(argv=sys.argv[1:]):
5858
parser.add_argument(
5959
'--extra-arg',
6060
type=str,
61+
action='append',
62+
dest='extra_arg',
6163
default=None,
6264
help='Additional argument to append to the compiler command line')
6365

@@ -158,7 +160,8 @@ def invoke_clang_tidy(compilation_db_path):
158160
if args.system_headers:
159161
cmd.append('--system-headers')
160162
if args.extra_arg:
161-
cmd.append('--extra-arg=' + args.extra_arg)
163+
for arg in args.extra_arg:
164+
cmd.append('--extra-arg=' + arg)
162165

163166
def is_gtest_source(file_name):
164167
if file_name == 'gtest_main.cc' or file_name == 'gtest-all.cc' \

0 commit comments

Comments
 (0)