合并受阻
变更摘要
本次 PR 仅修改 .pre-commit-config.yaml 中 clang-format 钩子的运行参数,将其行为由「自动格式化」改为「仅检查并强制失败」:args 从 [-style=file, -i] 调整为 [-style=file, --dry-run, --Werror]。改动后,pre-commit 钩子不再直接改写源码文件,而是在文件格式不符合 .clang-format 配置时以错误状态终止提交,迫使开发者先自行格式化代码,从而让格式检查更可控、更显式。
主要改动
clang-format改为只读检查:将-i(原地格式化)替换为--dry-run,钩子不再自动修改\.(h|c|cpp)$文件内容,仅输出格式差异。- 新增
--Werror严格模式:任何格式不符合要求的文件都会被视为错误并导致钩子失败,从而阻止未格式化的代码被提交。 - 保留
-style=file配置来源:仍沿用仓库根目录.clang-format文件中的样式定义,仅改变执行模式与失败策略。


Welcome To openEuler Community
Hey @huangxiaojun , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.
Contact Guide
If you have any questions, please contact the SIG: sig-UB-ServiceCore ,
and any of the maintainers: @Gao_Victor, @caowaterman, @hlinbo, @qmyyxtl, @shw030915 ,
and any of the committers: @HJLi96, @NotCold, @areigonglei, @yutao88 .


CLA Signature Guide
@huangxiaojun , thanks for your pull request.
The following commit(s) are not associated with a signed Contributor License Agreement (CLA).
| Commit | Reason |
|---|---|
| 63afe0ae update: 更新文件 .pre-commit... | the email used in the commit is an invalid email! please check all commits. |
To sign CLA, click here.
To check if your email is configured correctly, refer to the FAQs.
Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.


门禁正在运行, 您可以通过以下链接查看实时门禁检查结果.
若您对门禁结果含义不清晰或者遇到问题不知如何解决,可参考门禁指导手册
门禁入口及编码规范检查: multiarch/openeuler/trigger/ubs-virt/1269/console


✅ 跳过 docs ci 检查,没有需要检查的文档文件


| Check Name | Build Result | 详情 | Build Details | |
|---|---|---|---|---|
| check_sca | ✅SUCCESS | #1269 | ||
| check_code | ✅SUCCESS | |||
| check_package_license | ✅SUCCESS | |||
| x86_64 | check_build | ✅SUCCESS | #1262 | |
| aarch64 | check_build | ✅SUCCESS | #1286 | |
| pre-commit | check_build | ✅SUCCESS | #466 | |
| DT | check_build | ✅SUCCESS | #1169 | |
| check_issue_associate | check_build | ❌FAILED | #9481 | |


当前PR是否有AI参与:
[x] 否
[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :
参考:openEuler社区《生成式AI工具使用与开源贡献政策》
PR功能描述 / 为什么需要这个合入**:
该PR关联的issue
(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #
希望检视人员了解: