Adopt the TapHouse pre-commit clang-format hook#36
Merged
Conversation
Sync the canonical TapHouse .pre-commit-config.yaml (pins pre-commit/mirrors-clang-format at v18.1.3, the version CI uses) so a `git commit` formats staged C/C++ before it can be pushed, and switch the ci.yml clang-format job from an apt-installed clang-format-18 over an explicit file list to `pre-commit run --all-files`. Local and CI now share one clang-format version AND one file scope (all C/C++ minus third_party) by construction. The broader scope caught scripts/book_figures_trace.cpp — a real source file (the book's figure trace dumper) that the old explicit list didn't cover; it's now formatted. Everything else was already clean. The drift job still pins TapHouse@v2; bumping it to guard .pre-commit-config.yaml too is a separate re-sync-to-v3 follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLE2rvptWxV8catE8vTvgx
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.
Summary
Adopts the canonical TapHouse pre-commit config so a
git commitformats staged C/C++ with the same pinned clang-format the CI gate uses — no more format-only CI failures reachable locally.What
.pre-commit-config.yamlsynced from TapHouse — pinspre-commit/mirrors-clang-formatatv18.1.3, scoped to C/C++, excludingthird_party/.ci.yml— theclang-formatjob now runspre-commit run --all-filesinstead of an apt-installedclang-format-18over an explicit file list, so local and CI share one version and one file scope.scripts/book_figures_trace.cpp— formatted. The broader scope caught it (a real source file, the book's figure trace dumper) that the old explicit list didn't cover.Validation
The mirror's clang-format
v18.1.3is byte-identical to the aptclang-format-18the old job used, so this is a no-op on already-formatted code (onlybook_figures_trace.cppneeded it).pre-commit run --all-filespasses clean.Notes
driftjob still pinstap/taphouse@v2; leaving it there is intentional (that ref doesn't check.pre-commit-config.yaml, so adding the file doesn't break it). Fully drift-guarding the new file means bumping to TapHousev3and re-syncing — a separate follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_01TLE2rvptWxV8catE8vTvgx
Generated by Claude Code