已合并
更新.pre-commit-config.yaml,统一repo和rev #251
Whn0604创建于 19 天前
更新.pre-commit-config.yaml,统一repo和rev #251
已合并
Whn0604创建于 19 天前
Whn0604
19 天前

描述

更新.pre-commit-config.yaml,统一repo和rev

如何测试

文档更新

更新.pre-commit-config.yaml

类型标签

  • [√] 文档更新
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Whn0604 的贡献)
WWhn0604
19 天前 创建了 pull request,commit 7f799180
atomgit-bot
atomgit-bot
19 天前 评论:

变更摘要

本次 PR 对 .pre-commit-config.yaml 进行了全面重构与增强,主要目标是统一各 hook 的 repo 来源与 rev 版本,同时引入多项新的代码质量检查能力。具体包括:将 ruff 的镜像源改为官方仓库以与上游保持一致、升级 clang-format 版本、新增基础文本与安全检查、拼写检查以及开源合规检查等 hook,形成更完整的 pre-commit 检查流水线。

主要改动

  • 统一 ruff 仓库地址与参数格式:将 ruff-pre-commitrepohttps://gitcode.com/gh_mirrors/ru/ruff-pre-commit 改为官方源 https://github.com/astral-sh/ruff-pre-commit,同时将 ruff-checkargs 从空格分隔形式改为等号分隔(--output-format=github),确保配置规范一致。
  • 升级 clang-format 版本mirrors-clang-formatrevv16.0.0 升级至 v18.1.8,以适配更新的 C/C++ 格式化规则。
  • 新增 pre-commit-hooks 基础检查:引入官方 pre-commit-hooksv4.6.0),添加了 trailing-whitespaceend-of-file-fixercheck-yamlcheck-jsoncheck-added-large-filescheck-merge-conflictdetect-private-key 共 7 项基础文本与安全检查。
  • 新增 codespell 拼写检查:引入 codespell-project/codespellv2.4.1),并配置 tomli 作为额外依赖,拼写白名单由 .codespellrc 文件控制。
  • 新增本地 OAT 开源合规检查:添加 local 类型的 oat-check hook,通过 ./scripts/oat_check.sh 脚本在 pre-commit 阶段执行华为 OAT 开源合规扫描。
  • 添加 default_language_version 配置:显式声明默认 Python 版本为 python3,避免环境歧义。
likedislike
atomgit-bot
atomgit-bot
19 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
此处折叠了65条消息 查看更多
fujun19成员
17 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
17 天前 添加了label:lgtm
fujun19成员
17 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
17 天前 添加了label:approved
CANN-robotCANN-robot成员
17 天前 合入了pull request