Pin style-check and pre-commit to clang-format 23.1.0

CI relied on ubuntu-latest's default apt clang-format (18.1.3), while the
pre-commit hook was pinned to a different 18.x build. Neither tracked a
specific, deliberately-chosen version, and the two could drift from each
other and from whatever a contributor has installed locally.

Both now pin the same clang-format 23.1.0 (latest stable), installed via
pipx in CI. Also scope the pre-commit hook's file matcher to the same set
of files test/Makefile's style_check target checks, since the previous
\.(cpp|cc|h)$ pattern reached into vendored code (test/gtest,
benchmark/crow) that must stay untouched.

Reformat httplib.h's brace-init spacing to match 23.1.0's output.
This commit is contained in:
yhirose
2026-09-07 17:18:45 -04:00
parent 6303a99ce1
commit dc41dbd954
3 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8 # 最新バージョンを使用
rev: v23.1.0 # CIのstyle-checkと同じバージョンに揃える
hooks:
- id: clang-format
files: \.(cpp|cc|h)$
files: ^(httplib\.h|(example|fuzzing|test)/[^/]+\.(cpp|cc|h))$
args: [-i] # インプレースで修正