Skip to content

Commit

Permalink
docs: 更新规范文档/新增github action规范PR格式 (#3313)
Browse files Browse the repository at this point in the history
* docs: 更新规范文档/新增github action规范PR格式

* 新增github action规范PR格式优化
  • Loading branch information
LidolLxf committed Jun 28, 2024
1 parent 23b7d3e commit 68bf296
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pr-lint
on: [pull_request]
jobs:
PR-format-check:
runs-on: ubuntu-latest
steps:
- name: Check PR naming convention
run: |
title="${{ github.event.pull_request.title }}"
pattern="^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci): .*"
if [[ ! $title =~ $pattern ]]; then
echo "PR title does not match naming convention. Example: 'feat: 添加新功能'.\
You can refer to this address for details:\
https://github.com/TencentBlueKing/bk-bcs/blob/master/docs/specification/commit-spec.md"
exit 1
fi
18 changes: 11 additions & 7 deletions docs/specification/commit-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@

## 代码检查建议

BCS团队默认使用gometalinter进行代码检查,为了提高Merge效率,请提交前先使用[gometalinter](https://github.com/alecthomas/gometalinter)进行检查。
BCS团队默认使用golangci-lint进行代码检查,为了提高Merge效率,请提交前先使用[golangci-lint](https://github.com/golangci/golangci-lint)进行检查。

## commit相关格式

个人分支提交commit消息格式
个人分支提交commit消息格式,英文冒号,后跟英文空格

```
type:messsge issue
type: messsge issue
```

* type 范围信息
* feature 新功能
* fix 错误修复
* feat 添加新功能/新特性
* fix 错误修复,bug修复
* docs 文档更改
* style (格式化,缺少半冒号等;没有代码更改)
* refactor 代码重构重构
* style 代码格式化,如空格、缩进、缺少半冒号等;没有代码更改
* refactor 代码重构,没有添加新功能或bug修复
* perf 添加代码进行性能测试或性能优化
* test 添加缺失的测试,重构测试;没有生产代码更改
* chore 构建脚本,任务等相关代码
* revert 回滚某次提交
* build 构建系统或外部依赖项的更改(如webpack,npm,go.mod等)
* ci 持续集成相关的变动
* message 本次提交的描述
* issue 本次提交关联的issue id

Expand Down

0 comments on commit 68bf296

Please sign in to comment.