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

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 10 07:59:44 PDT 2020


njames93 added a comment.

In D79477#2028609 <https://reviews.llvm.org/D79477#2028609>, @hyd-dev wrote:

> This option sets `DiagOpts->ShowColors` to `true`. As I known, it controls **all** diagnostics reported by the `clang-tidy` program (by `clang::tidy::(anonymous namespace)::ErrorReporter`), including `clang-diagnostic-*` and other clang-tidy checks.


Would a test case be needed?



================
Comment at: clang-tools-extra/test/clang-tidy/infrastructure/use-color.cpp:10
+// RUN: clang-tidy -checks='-*, modernize-use-override' -extra-arg=-std=c++11 -use-color=false %s | FileCheck -check-prefix=CHECK-NO-COLOR %s
+// RUN: clang-tidy -checks='-*, modernize-use-override' -extra-arg=-std=c++11 %s | FileCheck -check-prefix=CHECK-NO-COLOR %s
+// RUN: clang-tidy -checks='-*, modernize-use-override' -extra-arg=-std=c++11 -use-color %s | FileCheck -check-prefix=CHECK-COLOR %s
----------------
Not a fan of this test case as it only demonstrates the color behaviour of the process running the check not the actual option itself


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

https://reviews.llvm.org/D79477





More information about the cfe-commits mailing list