Expose clang-tidy and clang-format as CMake targets#2506
Conversation
|
Curiously, the CMake-ized clang-tidy emits a bunch of warnings on the unmodified codebase, even though it is using the provided config file. A lot of the warnings are from ACTS headers, but there's 22 files in the EICrecon source tree that got reasonable-looking fixes. So I'm curious what CI is doing differently. |
for more information, see https://pre-commit.ci
Maybe you already figured this out, but CI only runs on changed files. People don't want to get issues flagged in files they didn't change. Over time, since we introduce this with clang-16 or so, this means that some newer clang-20 checks are not satisfied by code that hasn't been touched recently.
In CI we suppress issues in headers that are not under our version control. |
| @@ -0,0 +1,64 @@ | |||
| find_program(RUN_CLANG_TIDY run-clang-tidy-19) | |||
There was a problem hiding this comment.
eic-shell has clang-20 so this will fail.
| # Find<Modules>.cmake | ||
|
|
||
| # Expose clang-tidy and clang-format as (phony) CMake targets | ||
| include(cmake/CodeStyleTargets.cmake) |
There was a problem hiding this comment.
clang-tidy integration in CMake is already (bare bones) provided at
Line 98 in 27d95b4
Briefly, what does this PR introduce?
This PR introduces some new CMake targets for running clang-tidy and clang-format locally. This allows users to validate that their PR passes the style checks proactively and interactively, without having to wait for CI.
Does this PR introduce breaking changes? What changes might users need to make to their code?
Introduces no breaking changes.
Does this PR change default behavior?
Changes no default behavior.