| feat: add CRLF line-ending detection test and .gitattributes
Co-authored-by: yanhf<yanhaifeng5@huawei.com>
# message auto-generated for no-merge-commit merge:
!183 merge master into master
feat: add CRLF line-ending detection test and .gitattributes
Created-by: yanhf
Commit-by: yanhf
Merged-by: cann-robot
Description: 新特性 New Features
- 【代码看护】新增行尾检测单元测试 tests/unit/test-line-endings.sh:扫描仓库中所有文本文件,检测 DOS 风格
CRLF 行尾,发现时报告 FAIL。已集成到 --fast 默认拦截链,排在所有单测首位执行。
- 【代码看护】新增 .gitattributes:对所有文本文件类型(.c .h .py .sh .md .yaml .json 等)强制 eol=lf,从
Git 层防止未来提交引入 CRLF 行尾。
问题修复 Bug Fix
- 【代码看护】修复 22 个存量文件的 CRLF 行尾问题:涉及
ops/ascendc-direct-invoke-template、ops/ascendc-registry-invoke-template、ops/ascendc-code-review、plugins-
official/ops-direct-invoke、model/teams/infer-model-optimize-team 等模块。使用 dos2unix 统一转换为 Unix
LF。
---
关联的Issue
---
测试
- 新增的 tests/unit/test-line-endings.sh 已通过 20 项场景验证(含 CRLF
检测、二进制排除、目录排除、混合行尾、空文件等边缘用例),全部 PASS
- run-tests.sh --fast 集成验证通过,测试项共 10 个,新测试排首位并 PASS
- 修复后真实仓库扫描 882 个文件,确认无 CRLF 残留
---
文档更新
无
---
类型标签
- [x] 🌟 新特性
- [x] 🐛 Bug 修复
- [x] 🧪 测试用例
- [x] 🔧 配置变更
See merge request: cann/cannbot-skills!183 | 24 天前 |