erenon / bazel_clang_tidy

Run clang-tidy on Bazel C++ targets directly, efficiently, with caching enabled
MIT License
96 stars 51 forks source link

Only print anything on errors #50

Closed lalten closed 7 months ago

lalten commented 7 months ago

Let's have a dark cockpit. With this change, if you have no clang-tidy issues in any file, there will not be any output.

erenon commented 7 months ago

fmi: what's the purpose? doesn't the bazel UI hide output anyways?

lalten commented 7 months ago

fmi: what's the purpose? doesn't the bazel UI hide output anyways?

If the clang-tidy configuration causes the tool to print stuff but still exit 0, Bazel will show everything. You can try to put an echo hello in the run_clang_tidy.sh, it will be printed always

Example:

INFO: From Run clang-tidy on path/to/source.cpp:
2618 warnings generated.
Suppressed 2626 warnings (2618 in non-user code, 8 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
erenon commented 7 months ago

Thanks!