-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bazel] Add aspects to run clang-tidy #18537
Conversation
b9f411b
to
395a187
Compare
b4486b3
to
0614f67
Compare
0614f67
to
4d3aaee
Compare
Hey folks, PTAL when you get a chance! This is half-baked right now, but with Bazel's |
23853ce
to
f7bc9c3
Compare
This commit adds "fix" and "check" aspects that run clang-tidy. Example usage: ./bazelisk.sh build --config=clang_tidy_fix \ --config=riscv32 //sw/device/lib/base:memory ./bazelisk.sh build --config=clang_tidy_check \ --config=riscv32 //sw/device/lib/base:memory This also adds a new target, //quality:clang_tidy_check, which runs clang-tidy against a very incomplete list of hand-picked targets. Signed-off-by: Dan McArdle <[email protected]>
f7bc9c3
to
9e554af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aspect setup LGTM. I don't know enough about CcInfo to say more about the collection of the compiler flags and options.
acquire_lock(args.lock_file) | ||
|
||
compile_commands = Path("compile_commands.json") | ||
cleanup_func = maybe_rename_path( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need to address in this PR, but this might be a good use case for a with
context manager to handle the cleanup.
This commit adds "fix" and "check" aspects that run clang-tidy.
Example usage:
This also adds a new target, //quality:clang_tidy_check, which runs
clang-tidy against a very incomplete list of hand-picked targets.