[clang-tools-extra] af06ff1 - add -use-color option to clang-tidy-diff.py
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 18 06:14:42 PST 2021
Author: Jonas Otto
Date: 2021-02-18T09:12:48-05:00
New Revision: af06ff1cf87ecd387a65a6f7d4d00e0b06e983fb
URL: https://github.com/llvm/llvm-project/commit/af06ff1cf87ecd387a65a6f7d4d00e0b06e983fb
DIFF: https://github.com/llvm/llvm-project/commit/af06ff1cf87ecd387a65a6f7d4d00e0b06e983fb.diff
LOG: add -use-color option to clang-tidy-diff.py
Clang-tidy seems to output color only when printing directly to
terminal, but an option to force color-output has been added in
https://reviews.llvm.org/D7947
Added:
Modified:
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-
diff .py b/clang-tools-extra/clang-tidy/tool/clang-tidy-
diff .py
index 17086d15053e..6bd05531333b 100755
--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-
diff .py
+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-
diff .py
@@ -142,6 +142,8 @@ def main():
help='checks filter, when not specified, use clang-tidy '
'default',
default='')
+ parser.add_argument('-use-color', action='store_true',
+ help='Use colors in output')
parser.add_argument('-path', dest='build_path',
help='Path used to read a compile command database.')
if yaml:
@@ -225,6 +227,8 @@ def main():
common_clang_tidy_args.append('-quiet')
if args.build_path is not None:
common_clang_tidy_args.append('-p=%s' % args.build_path)
+ if args.use_color:
+ common_clang_tidy_args.append('--use-color')
for arg in args.extra_arg:
common_clang_tidy_args.append('-extra-arg=%s' % arg)
for arg in args.extra_arg_before:
More information about the cfe-commits
mailing list