1
0

feat: 原生 Git hooks 方案,增强版本升迁工作流

This commit is contained in:
2026-05-05 21:58:30 +08:00
parent 5655fc5560
commit a2751eab31
8 changed files with 476 additions and 18 deletions

View File

@@ -328,7 +328,13 @@ backend 分类测试、MySQL 专项测试和前端 E2E 测试请分别查看 `ba
```bash
# 首次克隆后安装 Git hooks
lefthook install
make hooks-install
# 检查 Git hooks 安装状态
make hooks-check
# 运行 Git hooks 回归测试
make hooks-test
# 全局命令
make lint # 前后端共享检查
@@ -351,6 +357,11 @@ make desktop-test # desktop 专属测试
make desktop-clean # 清理 desktop 产物
```
Git hooks 使用仓库内 `scripts/git-hooks/` 的原生脚本,不依赖额外 hook 框架。当前 hooks 包含:
- pre-commit检查 staged files 的冲突标记、Go lint、前端 lint/格式和大文件告警
- commit-msg校验提交信息格式为 `类型: 简短描述`,描述需使用中文
## 版本与发布
### 统一版本源
@@ -361,7 +372,7 @@ make desktop-clean # 清理 desktop 产物
### 本地版本演进
```bash
# 递增版本(自动 sync + check + commit + tag
# 递增版本(自动 lint + test + 工作区检查 + sync/check + commit + tag
make version-bump BUMP=minor
# 或指定具体版本号