Author: juliehockett Date: Fri Mar 9 15:26:56 2018 New Revision: 327186 URL: http://llvm.org/viewvc/llvm-project?rev=327186&view=rev Log: [clang-tidy] Update run-clang-tidy.py with config arg
Updating the run-clang-tidy.py script to allow specification of the config argument to the clang-tidy invocation. Differential Revision: https://reviews.llvm.org/D43538 Modified: clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py Modified: clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py?rev=327186&r1=327185&r2=327186&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py (original) +++ clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py Fri Mar 9 15:26:56 2018 @@ -75,7 +75,8 @@ def make_absolute(f, directory): def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, - header_filter, extra_arg, extra_arg_before, quiet): + header_filter, extra_arg, extra_arg_before, quiet, + config): """Gets a command line for clang-tidy.""" start = [clang_tidy_binary] if header_filter is not None: @@ -99,6 +100,8 @@ def get_tidy_invocation(f, clang_tidy_bi start.append('-p=' + build_path) if quiet: start.append('-quiet') + if config: + start.append('-config=' + config) start.append(f) return start @@ -157,7 +160,7 @@ def run_tidy(args, tmpdir, build_path, q invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks, tmpdir, build_path, args.header_filter, args.extra_arg, args.extra_arg_before, - args.quiet) + args.quiet, args.config) sys.stdout.write(' '.join(invocation) + '\n') subprocess.call(invocation) queue.task_done() @@ -177,6 +180,14 @@ def main(): parser.add_argument('-checks', default=None, help='checks filter, when not specified, use clang-tidy ' 'default') + parser.add_argument('-config', default=None, + help='Specifies a configuration in YAML/JSON format: ' + ' -config="{Checks: \'*\', ' + ' CheckOptions: [{key: x, ' + ' value: y}]}" ' + 'When the value is empty, clang-tidy will ' + 'attempt to find a file named .clang-tidy for ' + 'each source file in its parent directories.') parser.add_argument('-header-filter', default=None, help='regular expression matching the names of the ' 'headers to output diagnostics from. Diagnostics from ' _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits