[PATCH] D41720: [clang-tidy] Add a -show-color flag.

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 31 01:25:45 PST 2018


alexfh added inline comments.


================
Comment at: clang-tidy/ClangTidyOptions.h:93
+  /// \brief Show color diagnostics.
+  llvm::Optional<bool> ShowColor;
+
----------------
itessier wrote:
> alexfh wrote:
> > This doesn't belong to ClangTidyOptions. It's specific to the CLI, but CLI is not the only frontend for clang-tidy.
> Since we have to propagate the value to the ErrorReporter, how about adding a bool param to the ErrorReporter ctor? We could add a setter instead, but that would require moving a diag printer call out of the ctor since it uses the DiagOpts instance.
> 
> The colour logic would then be moved into either clangTidyMain or handleErrors.
A bool parameter in ErrorReporter ctor seems good.


https://reviews.llvm.org/D41720





More information about the cfe-commits mailing list