erenon / bazel_clang_tidy

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

Add clang_tidy bazel rule with example #65

Open wojciechmadry opened 1 month ago

wojciechmadry commented 1 month ago

Hi, I created a bazel rule so that it can be used as described in the readme.

This is not exactly the same solution, but the issue is mentioned here: #15

It is not perfect code, I created it for my own needs, but I think it can be a good base for future development.

I'm just sharing this, maybe it will be useful to someone.

erenon commented 1 month ago

Hi, thanks for the MR. I really like that this moves the check from the aspect build to a test step, because of the reasons in #15. Perhaps we should eventually move to this approach. I do not like the excess duplication of code - is there a reasonable way to reduce that?

wojciechmadry commented 1 month ago

I think so, I can try next week to make python functions public so they can be imported.

wojciechmadry commented 1 month ago

Hi, @erenon, Just FYI: I removed the duplicate code, making some functions public. The only thing I left is the implementation of the rule/aspect, as they are slightly different. They have a bit in common, but I think there is no point in breaking them into smaller functions. (Maybe in future)