erenon / bazel_clang_tidy

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

add support for toolchains with hermetic clang-tidy #31

Closed adrianimboden closed 2 years ago

adrianimboden commented 2 years ago

Thank you very much for this great project.

I tried to add it to our project. Our project uses a hermetic toolchain build, so I could not do it properly (e.g. remote execution does not work). I thought I add support for that as well.

The previous usage is not affected, so we support both hermetic and non-hermetic builds. For hermetic builds, this is the way it would work:

bazel build //... \
  --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect \
  --output_groups=report \
  --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config \
  --@bazel_clang_tidy//:clang_tidy_additional_deps=@local_config_cc//:system_header_files \
  --@bazel_clang_tidy//:clang_tidy_executable=@local_config_cc//:clangtidy_executable
erenon commented 2 years ago

Thanks!