-
Notifications
You must be signed in to change notification settings - Fork 62
Add global option to disable running clang-tidy on headers #79
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
base: master
Are you sure you want to change the base?
Conversation
Hi, thanks for the PR. FMI, what's the difference between this approach and using |
8d1576e
to
83a1214
Compare
@erenon Hi, sorry for the late reply. I updated the commit message with some more information. I think it should answer your questions. Let me know otherwise! |
83a1214
to
e5208c9
Compare
Fixed usage with bzlmod also, I had missed that first. |
Hi, thanks for the update. I still do not understand: why doesn't exclude-header-filter work in this case? |
What is |
ah, I can add |
* Commit f43f9d6 added support to run clang-tidy on headers. After that commit, all headers will be checked by clang-tidy. * Commit a01e5e2 added a tag to make it possible to not run clang-tidy on specific libraries. * For projects that only want to run clang-tidy on source files, the only way to disable running clang-tidy on headers is to add the above mentioned tag to all libraries. For large projects this requires changing all BUILD files. This commit adds a global option instead to always disable running clang-tidy on headers.
Before commit f43f9d6, the following invocation will be made by bazel when running on "//example:lib"
On commit f43f9d6, we are instead invoking clang-tidy twice, once on the cpp file and once on the header:
I would like to keep the previous behavior, where clang-tidy is only invoked on .cpp files, as headers are not buildable by themselves in the projects I am working on. The current workaround, introduced in a01e5e2, requires adding "no-clang-tidy-headers" to all libraries. This is impractical in a large project unfortunately. This pr introduces a global option to control this behavior, instead of using tags on all libs. "exclude-header-filter" might be possible, but bazel will still invoke clang-tidy on every header (unless I am missing something). |
No description provided.