Skip to content

Commit

Permalink
Merge pull request #42 from davidrohr/PR
Browse files Browse the repository at this point in the history
Add -extra-args option
  • Loading branch information
davidrohr authored Aug 27, 2024
2 parents d2738dd + 4c33e9e commit 6c28cce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tool/run_O2CodeChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def find_compilation_database(path):


def get_tidy_invocation(f, clang_tidy_binary, checks, warningsAsErrors, tmpdir, build_path,
header_filter, config):
header_filter, config, extra_args):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
if header_filter is not None:
Expand All @@ -77,6 +77,8 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, warningsAsErrors, tmpdir,
start.append('-warnings-as-errors=' + warningsAsErrors)
if config:
start.append('-config=' + config)
if extra_args is not None:
start.append(extra_args)
if tmpdir is not None:
start.append('-export-fixes')
# Get a temporary file. We immediately close the handle so clang-tidy can
Expand Down Expand Up @@ -104,7 +106,7 @@ def run_tidy(args, tmpdir, build_path, queue):
while True:
name = queue.get()
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks, args.warningsAsErrors,
tmpdir, build_path, args.header_filter, args.config)
tmpdir, build_path, args.header_filter, args.config, args.extra_args)
sys.stdout.write(' '.join(invocation) + '\n')
subprocess.call(invocation)
queue.task_done()
Expand All @@ -130,6 +132,8 @@ def main():
parser.add_argument('-config', default=None,
help='config option for check , when not specified, use clang-tidy '
'default')
parser.add_argument('-extra-args', default=None,
help='Extra arguments to pass to o2codechecker')
parser.add_argument('-header-filter', default=None,
help='regular expression matching the names of the '
'headers to output diagnostics from. Diagnostics from '
Expand Down

0 comments on commit 6c28cce

Please sign in to comment.