已合并
更新.pre-commit-config.yaml,统一repo和rev #251
Whn0604创建于 19 天前
更新.pre-commit-config.yaml,统一repo和rev #251
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Whn0604 的贡献)atomgit-bot
19 天前 评论:
19 天前 评论:
变更摘要
本次 PR 对 .pre-commit-config.yaml 进行了全面重构与增强,主要目标是统一各 hook 的 repo 来源与 rev 版本,同时引入多项新的代码质量检查能力。具体包括:将 ruff 的镜像源改为官方仓库以与上游保持一致、升级 clang-format 版本、新增基础文本与安全检查、拼写检查以及开源合规检查等 hook,形成更完整的 pre-commit 检查流水线。
主要改动
- 统一
ruff仓库地址与参数格式:将ruff-pre-commit的repo从https://gitcode.com/gh_mirrors/ru/ruff-pre-commit改为官方源https://github.com/astral-sh/ruff-pre-commit,同时将ruff-check的args从空格分隔形式改为等号分隔(--output-format=github),确保配置规范一致。 - 升级
clang-format版本:mirrors-clang-format的rev从v16.0.0升级至v18.1.8,以适配更新的 C/C++ 格式化规则。 - 新增
pre-commit-hooks基础检查:引入官方pre-commit-hooks(v4.6.0),添加了trailing-whitespace、end-of-file-fixer、check-yaml、check-json、check-added-large-files、check-merge-conflict和detect-private-key共 7 项基础文本与安全检查。 - 新增
codespell拼写检查:引入codespell-project/codespell(v2.4.1),并配置tomli作为额外依赖,拼写白名单由.codespellrc文件控制。 - 新增本地 OAT 开源合规检查:添加
local类型的oat-checkhook,通过./scripts/oat_check.sh脚本在pre-commit阶段执行华为 OAT 开源合规扫描。 - 添加
default_language_version配置:显式声明默认 Python 版本为python3,避免环境歧义。


atomgit-bot
19 天前 评论:
19 天前 评论:
19 天前 添加了label:cann-cla/yes
CANN-robot
19 天前 评论:
19 天前 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
For more, you also can visit HICANN
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/amct | ✅ fujun19, 姚广修 (2/2) | ✅ fujun19 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Whn0604, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了65条消息 查看更多
17 天前 添加了label:lgtm
17 天前 添加了label:approved
17 天前 合入了pull request
描述
更新.pre-commit-config.yaml,统一repo和rev
如何测试
文档更新
更新.pre-commit-config.yaml
类型标签