Index: clang-tidy/tool/run-clang-tidy.py =================================================================== --- clang-tidy/tool/run-clang-tidy.py +++ clang-tidy/tool/run-clang-tidy.py @@ -75,7 +75,8 @@ 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 @@ 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 @@ 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 @@ 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 '