Skip to content

Scope clang-tidy to only project root source files#47

Closed
philipcraig wants to merge 2 commits intojbcoe:mainfrom
philipcraig:claude/fix-clang-tidy-scope-i6Idm
Closed

Scope clang-tidy to only project root source files#47
philipcraig wants to merge 2 commits intojbcoe:mainfrom
philipcraig:claude/fix-clang-tidy-scope-i6Idm

Conversation

@philipcraig
Copy link
Copy Markdown
Collaborator

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

@philipcraig philipcraig requested a review from jbcoe as a code owner March 30, 2026 22:02
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
@philipcraig philipcraig force-pushed the claude/fix-clang-tidy-scope-i6Idm branch from f8b24bb to b176158 Compare March 30, 2026 22:06
@philipcraig
Copy link
Copy Markdown
Collaborator Author

Don't review yet. I will post again for review

@philipcraig
Copy link
Copy Markdown
Collaborator Author

Don't review yet. I will post again for review

Ok good to go

@philipcraig philipcraig requested a review from Twon March 30, 2026 22:13
Copy link
Copy Markdown
Owner

@jbcoe jbcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@philipcraig
Copy link
Copy Markdown
Collaborator Author

closed in favour of #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clang-tidy CI checks are running checks that we don't need

4 participants