Scope clang-tidy to only project root source files#47
Closed
philipcraig wants to merge 2 commits intojbcoe:mainfrom
Closed
Scope clang-tidy to only project root source files#47philipcraig wants to merge 2 commits intojbcoe:mainfrom
philipcraig wants to merge 2 commits intojbcoe:mainfrom
Conversation
Disable CMAKE_CXX_CLANG_TIDY before FetchContent_MakeAvailable for googletest and google_benchmark, then restore it afterward. This ensures clang-tidy only runs on our own source code and not on third-party dependencies. Closes jbcoe#39 https://claude.ai/code/session_013uCeZ4imd8797XyofRvkW4
f8b24bb to
b176158
Compare
Collaborator
Author
|
Don't review yet. I will post again for review |
Collaborator
Author
Ok good to go |
jbcoe
reviewed
Mar 30, 2026
Owner
jbcoe
left a comment
There was a problem hiding this comment.
I think that this will still run on our own benchmark code which clang tidy does not like (Google benchmark has many oddities).
We have #41 which further restricts the scope of clang-tidy checks. Which do you @philipcraig prefer?
Collaborator
Author
|
closed in favour of #41 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the fragile --exclude_dirs blacklist approach with a --root-only flag that only includes files directly in the project root. This ensures clang-tidy never runs on dependencies (Google Test, Google Benchmark) or any future subdirectory code, without needing to maintain a list of excluded directories.
Closes #39
https://claude.ai/code/session_013uCeZ4imd8797XyofRvkW4