Use --use-color in run-clang-tidy.py
authorDavid Sanders <dsanders11@ucsbalum.com>
Mon, 2 Nov 2020 13:38:20 +0000 (08:38 -0500)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 2 Nov 2020 13:38:20 +0000 (08:38 -0500)
Now that clang-tidy supports the --use-color command line option, it's
a better user experience to use --use-color in run-clang-tidy.py and
preserving the colored output.

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

index 7e23419..313ecd2 100755 (executable)
@@ -83,7 +83,7 @@ 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):
   """Gets a command line for clang-tidy."""
-  start = [clang_tidy_binary]
+  start = [clang_tidy_binary, '--use-color']
   if allow_enabling_alpha_checkers:
     start.append('-allow-enabling-analyzer-alpha-checkers')
   if header_filter is not None: