Fix clang tidy workflow#8487
Conversation
Signed-off-by: Sombrio <sombrio@sombrasoft.dev>
Signed-off-by: Sombrio <sombrio@sombrasoft.dev>
|
clang-tidy review says "All clean, LGTM! 👍" |
|
@hzeller Do you have any experience with setting up a |
|
This is what I do do get This might already be sufficient to extract and use the same Note, the For clean-up efforts and this output I run the script in To run So to put everything together: create compilation db once (I prefer the compile_flags as it is much shorter than the json version, but as good for our purposes): bant compile-flags -o compile_flags.txt # before that, build at least once; call again when on MODULE.bazel change.And the following runs # This only uses the clang-tidy already configured for the llvm-toolchain in bazel
CLANG_TIDY=$(bazel run -c opt --run_under="echo" @llvm_toolchain//:clang-tidy 2>/dev/null) etc/run-clang-tidy-cached.ccThe output is a script-friendly This is all I use to prepare all my clean-up pull requests (using the output in There could probably ways to run clang-tidy directly from bazel, but never tried that and whatever it has to do would be an ugly knowing-the-internals-of-bazel-actions hack, and we're spcifically tying us into an undocumented part of a somewhat moving target of a tool. External scripts are much nicer to do that. |
Although the base image for our
clang-tidydependency (openroad/ubuntu22.04-dev:latest) is built using dependencyInstaller.sh and should havelibyaml-cpp-devinstalled, for some reason it wasn't.