build(clang-tidy): replace clang-tidy scripts with CMake approach#142
Merged
ingomueller-net merged 1 commit intosubstrait-io:mainfrom Mar 26, 2026
Merged
Conversation
b0699f1 to
79f60e5
Compare
This PR replaces the clang-tidy scripts with a CMake-based approach. The core mechanism is to define CMake's `CMAKE_CXX_CLANG_TIDY` variable, which invokes clang-tidy whenever a C++ target is compiled. The remainder consists of some logic that finds the clang-tidy executable and its arguments as well as activating and deactivating the command in the right place (in particular, to exclude checking third-party code). I see three main advantages to the new approach: (1) The new logic is considerably simpler than the previous scripts. (2) The code is automatically checked when it compiled, potentially saving round-trips through CI. (3) We save an extra 10 minutes on CI for recompiling the whole project, which the previous scripts did, this brings the `check` CI job down to about 1 minute. The PR also does three minor changes: (1) It removes the `AnalyzeTemporaryDtors` configuration, which was depcrecated in clang 16 and removed in clang 18. (2) It applies the suggested fixes for one class of errors that my clang-tidy-22 complained about. (3) It disables the tests of the protobuf-matchers dependency, which were meant to be disabled, but in a way that didn't work. Note that that latter point will be obsolete with substrait-io#139. Signed-off-by: Ingo Müller <ingomueller@google.com>
79f60e5 to
c40d2ed
Compare
EpsilonPrime
approved these changes
Mar 26, 2026
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.
This PR replaces the clang-tidy scripts with a CMake-based approach. The core mechanism is to define CMake's
CMAKE_CXX_CLANG_TIDYvariable, which invokes clang-tidy whenever a C++ target is compiled. The remainder consists of some logic that finds the clang-tidy executable and its arguments as well as activating and deactivating the command in the right place (in particular, to exclude checking third-party code).I see three main advantages to the new approach: (1) The new logic is considerably simpler than the previous scripts. (2) The code is automatically checked when it compiled, potentially saving round-trips through CI. (3) We save an extra 10 minutes on CI for recompiling the whole project, which the previous scripts did.
The PR also does two minor changes: (1) It removes the
AnalyzeTemporaryDtorsconfiguration, which was depcrecated in clang 16 and removed in clang 18. (2) It applies the suggested fixes for one class of errors that my clang-tidy-22 complained about.