bazel_clang_tidy
bazel_clang_tidy copied to clipboard
Add target to apply clang-tidy fixes
When I run the example with:
bazel build //example --aspects clang_tidy/clang_tidy.bzl%clang_tidy_aspect --output_groups=report
this silently succeeds. If instead I run
bazel build //... --aspects clang_tidy/clang_tidy.bzl%clang_tidy_aspect --output_groups=report
I get the expected lint warning.
I get tidy fixes applied with
bazel run :apply_fixes
or
bazel run :apply_fixes -- //...
any update?
@oliverlee
Hi, tried to use the fix patch, however, it seems to be confused by sandbox.
I tried to add back no-sandbox
inside https://github.com/erenon/bazel_clang_tidy/commit/99ed470c25033baafe9ddd0634bc269f15b64b16, it succeed in fixing the std::string problem.
dongxu@MiDX01:~/ws/micah/tmp/bazel_clang_tidy$ bazelisk run :apply_fixes //...
INFO: Invocation ID: 2334cead-3d8a-4851-9396-e18a3046da53
INFO: Analyzed target //:apply_fixes (1 packages loaded, 1 target configured).
INFO: Found 1 target...
Target //:apply_fixes up-to-date:
bazel-bin/clang_tidy.apply_fixes.sh
INFO: Elapsed time: 0.045s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/clang_tidy.apply_fixes.sh //...
Described file '/home/dongxu/.cache/bazel/_bazel_dongxu/7cea99f25702216cc5bfbca1e10eeac0/sandbox/linux-sandbox/11/execroot/bazel_clang_tidy/example/lib.cpp' doesn't exist. Ignoring...
Described file '/home/dongxu/.cache/bazel/_bazel_dongxu/7cea99f25702216cc5bfbca1e10eeac0/sandbox/linux-sandbox/11/execroot/bazel_clang_tidy/example/lib.hpp' doesn't exist. Ignoring...