Abpostelnicu created this revision. Abpostelnicu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Afer this <https://github.com/llvm/llvm-project/commit/a07a2c88d96cc48d7d381a0300565090c24b9770> commit landed we always have coloured diagnotic messages. Maybe it's a good idea to leave the user the posibility of opting out of this. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D93543 Files: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 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 @@ -80,10 +80,13 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, - header_filter, allow_enabling_alpha_checkers, - extra_arg, extra_arg_before, quiet, config): + header_filter, no_diagnostic_color, + allow_enabling_alpha_checkers, extra_arg, + extra_arg_before, quiet, config): """Gets a command line for clang-tidy.""" - start = [clang_tidy_binary, '--use-color'] + start = [clang_tidy_binary] + if not no_diagnostic_color: + start.append('--use-color') if allow_enabling_alpha_checkers: start.append('-allow-enabling-analyzer-alpha-checkers') if header_filter is not None: @@ -163,6 +166,7 @@ name = queue.get() invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks, tmpdir, build_path, args.header_filter, + args.no_diagnostic_color, args.allow_enabling_alpha_checkers, args.extra_arg, args.extra_arg_before, args.quiet, args.config) @@ -204,6 +208,8 @@ '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('-no-diagnostic-color', action='store_true', + help='Disable diagnostic message colors.') parser.add_argument('-header-filter', default=None, help='regular expression matching the names of the ' 'headers to output diagnostics from. Diagnostics from '
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 @@ -80,10 +80,13 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, - header_filter, allow_enabling_alpha_checkers, - extra_arg, extra_arg_before, quiet, config): + header_filter, no_diagnostic_color, + allow_enabling_alpha_checkers, extra_arg, + extra_arg_before, quiet, config): """Gets a command line for clang-tidy.""" - start = [clang_tidy_binary, '--use-color'] + start = [clang_tidy_binary] + if not no_diagnostic_color: + start.append('--use-color') if allow_enabling_alpha_checkers: start.append('-allow-enabling-analyzer-alpha-checkers') if header_filter is not None: @@ -163,6 +166,7 @@ name = queue.get() invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks, tmpdir, build_path, args.header_filter, + args.no_diagnostic_color, args.allow_enabling_alpha_checkers, args.extra_arg, args.extra_arg_before, args.quiet, args.config) @@ -204,6 +208,8 @@ '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('-no-diagnostic-color', action='store_true', + help='Disable diagnostic message colors.') 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 https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits