3

A recent change to run-clang-tidy.py means that the underlying clang-tidy command is now always run with -use-color. The question is how to disable that.

I use this script with the Sonarqube Community C++ plugin and this cannot handle the extra colourisation characters - FTR it reports that all the files cannot be found in the associated repo.

I have tried adding extra parameter -config '{"UseColor":false}' but it made no difference.

Short term, I will probably locally modify the python script. Long term, I wonder if there is a better approach?

johnfo
  • 1,676
  • 2
  • 17
  • 28

1 Answers1

2

This issue is now fixed in LLVM's main branch and should be resolved in the next release. The old default behavior has been restored and you'll be able to explicitly opt in or out of colored output using the -use-color option.

As a short-term fix, you can strip out the ANSI escape characters that enable colored output yourself. See Removing colors from output for instructions.