Skip to content

Commit 6c28cce

Browse files
authored
Merge pull request #42 from davidrohr/PR
Add -extra-args option
2 parents d2738dd + 4c33e9e commit 6c28cce

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tool/run_O2CodeChecker.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def find_compilation_database(path):
6363

6464

6565
def get_tidy_invocation(f, clang_tidy_binary, checks, warningsAsErrors, tmpdir, build_path,
66-
header_filter, config):
66+
header_filter, config, extra_args):
6767
"""Gets a command line for clang-tidy."""
6868
start = [clang_tidy_binary]
6969
if header_filter is not None:
@@ -77,6 +77,8 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, warningsAsErrors, tmpdir,
7777
start.append('-warnings-as-errors=' + warningsAsErrors)
7878
if config:
7979
start.append('-config=' + config)
80+
if extra_args is not None:
81+
start.append(extra_args)
8082
if tmpdir is not None:
8183
start.append('-export-fixes')
8284
# Get a temporary file. We immediately close the handle so clang-tidy can
@@ -104,7 +106,7 @@ def run_tidy(args, tmpdir, build_path, queue):
104106
while True:
105107
name = queue.get()
106108
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks, args.warningsAsErrors,
107-
tmpdir, build_path, args.header_filter, args.config)
109+
tmpdir, build_path, args.header_filter, args.config, args.extra_args)
108110
sys.stdout.write(' '.join(invocation) + '\n')
109111
subprocess.call(invocation)
110112
queue.task_done()
@@ -130,6 +132,8 @@ def main():
130132
parser.add_argument('-config', default=None,
131133
help='config option for check , when not specified, use clang-tidy '
132134
'default')
135+
parser.add_argument('-extra-args', default=None,
136+
help='Extra arguments to pass to o2codechecker')
133137
parser.add_argument('-header-filter', default=None,
134138
help='regular expression matching the names of the '
135139
'headers to output diagnostics from. Diagnostics from '

0 commit comments

Comments
 (0)