Pull Request已成功合入, 合并人@CANN-robot
(感谢 liu-wei 的贡献)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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/ops-cv | ✅ llimwang, loov1 (2/2) | ✅ llimwang (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
liu-wei, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


问题/功能描述
本次PR旨在为项目建立一套代码提交前的自动化检查与质量保障机制,以提升代码规范性和开源合规性。主要解决了两个问题:一是通过配置.gitignore文件,忽略构建产物、测试报告和日志等非源码文件,保持代码仓库的整洁;二是通过引入pre-commit框架,在代码提交前自动执行代码格式化(C/C++)和开源合规性检查,从源头保障代码质量。
修改方案描述
修改方案包含两部分核心内容。首先,更新了.gitignore文件,新增了对oat_reports/和log/目录的忽略规则。其次,新增了.pre-commit-config.yaml配置文件,集成了clang-format代码格式化钩子和一个自定义的OAT(开源审计工具)合规性检查脚本钩子。该自定义脚本(scripts/oat_check.sh)实现了环境自愈(自动修复CRLF、安装Java/Maven依赖)、自动获取并构建OAT工具、以增量模式扫描待提交文件,并生成合规性检查报告摘要,从而构建了一个完整、自动化且对开发者友好的预提交检查流程。


流水线任务触发成功
任务链接 [48038dc8bc9e4c46850ae54c69a564ee][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ❌ FAILED | ||
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Pre_Compile | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ⚠️ WARNING | >>>>> | |
| UT_Test | ⚪ ABORTED | ||
| Smoke_A900_npupool | ⚪ ABORTED | ||
| API_Check | ⚪ ABORTED | >>>>> | |
| ATK_Test_A2 | ⚪ ABORTED |
[2026-03-31 19:36:21] CI执行失败


compile


流水线任务触发成功
任务链接 [d72d062e6bf1444eaec352faeda28738][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ❌ FAILED | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Pre_Compile | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ⚠️ WARNING | >>>>> | |
| UT_Test | ⚪ ABORTED | ||
| Smoke_A900_npupool | ⚪ ABORTED | ||
| API_Check | ⚪ ABORTED | >>>>> | |
| ATK_Test_A2 | ⚪ ABORTED |
[2026-03-31 19:44:27] CI执行失败


代码审查报告
PR 概述
添加 pre-commit 钩子,支持 OAT(Open Audit Tool)合规检查流程。
变更文件
| 文件 | 增/删 |
|---|---|
| .gitignore | +4 / -1 |
| .pre-commit-config.yaml | +18 |
| scripts/oat_check.sh | +532 |
主要功能
-
新增 pre-commit 配置 ()
- 集成 OAT 合规检查脚本
- 支持增量扫描模式
-
OAT 检查脚本 ()
- 自动检测 Java/Maven 环境
- 自动安装依赖(Java 21、Maven)
- 增量扫描 staged 文件的许可证头和二进制文件
- CRLF 行尾自动修复
- 自动将 和 加入 .gitignore
-
.gitignore 更新
- 忽略 OAT 报告输出目录
审查结论
| 项目 | 结论 |
|---|---|
| 建议 | ✅ 建议合入 |
| 严重性 | Low |
| 代码质量 | 良好 |
| 内存安全 | ✅ 无风险 |
| 安全性 | ✅ 无漏洞 |
建议补充
- PR 描述中「关联的Issue」和「测试」标记为 todo,建议补充具体信息
- 建议在 README 中添加 pre-commit 使用说明
此审查由 AI 自动生成


代码审查报告
PR 概述
添加 pre-commit 钩子,支持 OAT(Open Audit Tool)合规检查流程。
变更文件
.gitignore(+4/-1).pre-commit-config.yaml(+18)scripts/oat_check.sh(+532)
主要功能
- 新增 pre-commit 配置,集成 OAT 合规检查
- OAT 脚本自动检测并安装 Java 21、Maven
- 增量扫描 staged 文件的许可证头和二进制文件
- CRLF 行尾自动修复
- 自动将 oat_reports/ 和 log/ 加入 .gitignore
审查结论
| 项目 | 结论 |
|---|---|
| 建议 | ✅ 建议合入 |
| 严重性 | Low |
| 代码质量 | 良好 |
| 内存安全 | ✅ 无风险 |
| 安全性 | ✅ 无漏洞 |
建议补充
- PR 描述中「关联的Issue」和「测试」标记为 todo,建议补充
- 建议在 README 中添加 pre-commit 使用说明
此审查由 AI 自动生成


代码审查报告
PR 概述
添加 pre-commit 钩子,支持 OAT(Open Audit Tool)合规检查流程。
变更文件
.gitignore(+4/-1).pre-commit-config.yaml(+18)scripts/oat_check.sh(+532)
主要功能
- 新增 pre-commit 配置,集成 OAT 合规检查
- OAT 脚本自动检测并安装 Java 21、Maven
- 增量扫描 staged 文件的许可证头和二进制文件
- CRLF 行尾自动修复
- 自动将 oat_reports/ 和 log/ 加入 .gitignore
审查结论
| 项目 | 结论 |
|---|---|
| 建议 | ✅ 建议合入 |
| 严重性 | Low |
| 代码质量 | 良好 |
| 内存安全 | ✅ 无风险 |
| 安全性 | ✅ 无漏洞 |
建议补充
- PR 描述中「关联的Issue」和「测试」标记为 todo,建议补充
- 建议在 README 中添加 pre-commit 使用说明
此审查由 AI 自动生成


compile


流水线任务触发成功
任务链接 [410a282c456b448fa62348be9c70b584][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ❌ FAILED | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Pre_Compile | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ⚠️ WARNING | >>>>> | |
| UT_Test | ⚪ ABORTED | ||
| Smoke_A900_npupool | ⚪ ABORTED | ||
| API_Check | ⚪ ABORTED | >>>>> | |
| ATK_Test_A2 | ⚪ ABORTED |
[2026-03-31 20:29:43] CI执行失败


compile


流水线任务触发成功
任务链接 [1c44db1134cb4856aae8e882422e299c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Pre_Compile | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| UT_Test | ✅ SUCCESS | ||
| Smoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| ATK_Test_A2 | ✅ SUCCESS |
[2026-03-31 20:57:49] CI执行结束


描述
support pre commit function flow.
添加 pre-commit 钩子,支持 OAT(Open Audit Tool)合规检查流程。
关联的Issue
https://gitcode.com/cann/ops-cv/issues/280
测试
pre commit oat check等功能本地执行成功。
文档更新
不涉及文档更新
类型标签