fix(hooks): upgrade clang-format to 15.0.6 - #322
Merged
Conversation
# 🐛 Bug Fix - Use the 15.0.6 macOS wheel with native arm64 support instead of the x86_64-only binary shipped in the 14.0.6 universal2 wheel. - Preserve the hook manifest, file selection and formatting defaults. - Verify full pre-commit/prek runs and zero format delta on all ten currently matched files; leave unrelated formatters unchanged.
Nyanpasu 审查看板审查状态: ✅ 已通过 审查版本: 已完成审查:仅将 clang-format hook 从 v14.0.6 升级到 v15.0.6。两版 manifest 行为一致,受选中的 10 个文件格式零差异,未发现阻塞或需修改的问题。CI 结果:Pre-commit 检查通过;Python 3.10 测试套件有 1 例失败(tests/engine/sft/dataset/test_streaming.py::test_streaming_dataset_missing_media_skip_refills_batch[prefetch],日志显示告警实际已输出但 prefetch 后台线程下未被 captured_warnings 捕获),与本仅配置变更无关,属该测试的日志捕获时序问题。 没有未解决的审查问题。
Powered by Nyanpasu with claude-opus-5-google[1m] medium, please check the suggestions carefully.
|
rai-studio-bot
approved these changes
Sep 17, 2026
rai-studio-bot
left a comment
There was a problem hiding this comment.
仅将 pre-commit/mirrors-clang-format 的 rev 从 v14.0.6 升到 v15.0.6,无其他改动。
已核验:
- v14.0.6 与 v15.0.6 的 hook manifest 行为一致(
entry、types_or、args: -style=file、minimum_pre_commit_version均相同),仅 clang-format 版本不同。 - 当前受该 hook 选中的 10 个已跟踪文件(8 JSON、1 JS、1 CUDA)与 PR 描述一致;仓库无
.clang-format,沿用 LLVM fallback 风格。 - 变更符合最小改动原则,PR 描述对格式零差异、原生 arm64 分发等已给出充分证据。
未见阻塞性或需修改的问题。Python 测试 CI 仍在运行中,与本配置变更无直接关系。
Powered by Nyanpasu with claude-opus-5-google[1m] medium, please check the suggestions carefully.
SigureMo
enabled auto-merge (squash)
September 17, 2026 07:59
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.
What
Bump
pre-commit/mirrors-clang-formatfrom v14.0.6 to v15.0.6. This is a one-line hook revision change; no source files, other hooks, dependencies of Relax, or CI workflows change.Why
Remove the hook's Rosetta dependency on Apple Silicon:
clang_format-14.0.6-py2.py3-none-macosx_10_9_universal2.whl, but its bundled executable is x86_64 only. Forcing native execution witharch -arm64 …/clang_format/data/bin/clang-format --versionfails withBad CPU type in executable.macosx_10_9_universal2, contains both x86_64 and arm64. The same native execution check succeeds. Inspecting the actual executable matters: the wheel tag alone is insufficient evidence.arm64-apple-darwin21.0archive. The hook uses ssciwr's published PyPI wheel, not an LLVM-published Python wheel or that release archive.This addresses the architecture mismatch relevant to macOS 27 machines without usable Rosetta. Local execution was tested on macOS 26.6.2 arm64, not macOS 27; this PR does not claim an OS-specific macOS 27 validation or that every Apple Silicon machine fails with 14.0.6. The old hook works on this host through Rosetta.
How
The v15.0.6 mirror pins
clang-format==15.0.6. Its hook manifest is identical to v14.0.6: Python environment,clang-format -i,-style=file, the same file types and minimum pre-commit version. The existingtransfer_queue/exclusion is unchanged. There is no repository.clang-format/_clang-format, so the LLVM fallback style remains in use.LLVM 15 changes some C++ concepts/requires formatting defaults, so this is not a promise that versions 14 and 15 format all future code identically. For all 10 currently hook-selected tracked files (eight JSON, one JavaScript, one CUDA), both versions' formatted output is byte-identical to the checked-in file. Formatting delta: zero files; no bulk reformatting.
Testing
pre-commit run --all-files --show-diff-on-failurepasses: all 15 hooks, before and after the upgrade, usinguv run --no-project --python 3.10 --with pre-commit …(matching CI's Python minor version).prek run --all-files --show-diff-on-failurepasses: all 15 hooks with prek 0.5.2.git diff --checkpasses.--dry-run --Werror -style=filepasses for the JavaScript and CUDA files.test_streaming_dataset_missing_media_skip_refills_batch[prefetch]. No unrelated test changes were made. Not run locally for this configuration-only change. Multi-node GPU integration tests are not run: no GPU cluster is available.Validation caveats, intentionally not mixed into this PR:
offset=0,length=0, empty text) under--dry-run --Werror, despite identical formatted bytes. JSON validation therefore uses output comparison and the actual-ihook; this is not a new regression.docformatter==1.3.1(ast.Constant.s). Running pre-commit with Python 3.10 passes; prek also passes (its docformatter environment uses Python 3.10). No unrelated docformatter changes are included.Type of Change
Screenshots / Logs
@Yangruipis Please review this hook-only upgrade.