[PATCH] D79477: [clang-tidy] Add --color-diagnostics command line option and ColorDiagnostics option to control colors in diagnostics

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 6 09:07:33 PDT 2020


hokein added a comment.

mostly good, just nits.



================
Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.h:130
+
+  /// Use colors in diagnostics. If missing, colors will be used if standard
+  /// output is connected to a terminal.
----------------
nit: ... wil be used if the terminal connected to standard output supports colors, or even simple `if missing, it will be auto detect`.


================
Comment at: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:232
 
+static cl::opt<bool> ColorDiagnostics("color-diagnostics", cl::desc(R"(
+Use colors in diagnostics. If not set, colors
----------------
nit: just `use-color`


================
Comment at: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:236
+to a terminal.
+)"),
+                                      cl::cat(ClangTidyCategory));
----------------
nit: set `cl::init(false)`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79477/new/

https://reviews.llvm.org/D79477





More information about the cfe-commits mailing list