Index: clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py =================================================================== --- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -158,6 +158,9 @@ action='append', default=[], help='Additional argument to prepend to the compiler ' 'command line.') + parser.add_argument('-extra-arg-clang-tidy', dest='extra_arg_clang_tidy', + action='append', default=[], + help='Additional argument to use with clang-tidy.') parser.add_argument('-quiet', action='store_true', default=False, help='Run clang-tidy in quiet mode') clang_tidy_args = [] @@ -233,6 +236,7 @@ common_clang_tidy_args.append('-extra-arg=%s' % arg) for arg in args.extra_arg_before: common_clang_tidy_args.append('-extra-arg-before=%s' % arg) + common_clang_tidy_args += args.extra_arg_clang_tidy for name in lines_by_file: line_filter_json = json.dumps( Index: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py =================================================================== --- clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +++ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py @@ -104,6 +104,7 @@ start.append('-extra-arg=%s' % arg) for arg in extra_arg_before: start.append('-extra-arg-before=%s' % arg) + common_clang_tidy_args += args.extra_arg_clang_tidy start.append('-p=' + build_path) if quiet: start.append('-quiet') @@ -241,6 +242,9 @@ action='append', default=[], help='Additional argument to prepend to the compiler ' 'command line.') + parser.add_argument('-extra-arg-clang-tidy', dest='extra_arg_clang_tidy', + action='append', default=[], + help='Additional argument to use with clang-tidy.') parser.add_argument('-quiet', action='store_true', help='Run clang-tidy in quiet mode') args = parser.parse_args()