Skip to content

Commit 87d12c6

Browse files
committed
feat: allow to pass extra-arg argument to clang-tidy
1 parent 243cf69 commit 87d12c6

File tree

1 file changed

+7
-0
lines changed
  • ament_clang_tidy/ament_clang_tidy

1 file changed

+7
-0
lines changed

ament_clang_tidy/ament_clang_tidy/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ def main(argv=sys.argv[1:]):
5555
type=int,
5656
default=1,
5757
help='number of clang-tidy jobs to run in parallel')
58+
parser.add_argument(
59+
'--extra-arg',
60+
type=str,
61+
default=None,
62+
help='Additional argument to append to the compiler command line')
5863

5964
# not using a file handle directly
6065
# in order to prevent leaving an empty file when something fails early
@@ -152,6 +157,8 @@ def invoke_clang_tidy(compilation_db_path):
152157
cmd.append('--quiet')
153158
if args.system_headers:
154159
cmd.append('--system-headers')
160+
if args.extra_arg:
161+
cmd.append('--extra-arg=' + args.extra_arg)
155162

156163
def is_gtest_source(file_name):
157164
if(file_name == 'gtest_main.cc' or file_name == 'gtest-all.cc'

0 commit comments

Comments
 (0)