[PATCH] D94624: [PATCH] [clang-query] Add a --use-color option to clang-query to allow forcing the behavior

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 14 07:16:04 PST 2021


aaron.ballman added a comment.

In D94624#2498201 <https://reviews.llvm.org/D94624#2498201>, @tomrittervg wrote:

> Actually, I think I need to be smarter than changing the default. We want to let clang auto-detect the tty and behave that way by default if the option isn't specified. Otherwise you'd get ASNI color codes when you pipe to a file.

+1 to this, but also, you need to thread the option through to the diagnostics engine as well.

For reference, here are some screenshots of what I'm seeing on Windows with your original patch applied when running clang-query and clang-tidy. Note the difference in diagnostic text colorization where clang-tidy controls it via `use-color` and clang-query currently does not.

F15036446: tidy-no-opt.PNG <https://reviews.llvm.org/F15036446>

F15036445: query-explicit-on.PNG <https://reviews.llvm.org/F15036445>

F15036444: tidy-explicit-on.PNG <https://reviews.llvm.org/F15036444>

F15036443: tidy-explicit-off.PNG <https://reviews.llvm.org/F15036443>

F15036442: query-explicit-off.PNG <https://reviews.llvm.org/F15036442>

F15036441: query-no-opt.PNG <https://reviews.llvm.org/F15036441>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94624



More information about the cfe-commits mailing list