Skip to content

Commit

Permalink
docs: add CHANGELOG template and configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ClessLi committed Jan 26, 2022
1 parent 1a2bd6d commit a49e9d7
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .MergeCommits -}}
### Pull Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
51 changes: 51 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/ClessLi/bifrost
options:
commits:
filters:
Type:
- feat
- fix
- perf
# - style
- refactor
# - test
# - ci
# - docs
# - chore
sort_by: Scope
commit_groups:
group_by: Type
sort_by: Title
title_order:
- feat
- fix
- perf
# - style
- refactor
# - test
# - ci
# - docs
# - chore
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
# style: Code Formatting
refactor: Code Refactoring
# test: Test Code Changes
# ci: Deployment Related Changes
# docs: Documents Changes
# chore: Other Changes
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
14 changes: 14 additions & 0 deletions docs/devel/zh-CN/scope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Bifrost commit message scope

| scope | description |
|------------------------|---------------------------------------|
| bifrost | bifrost 组件相关的变更 |
| web_server_config | bifrost 中 WebServerConfig 模块相关的变更 |
| web_server_status | bifrost 中 WebServerStatus 模块相关的变更 |
| web_server_statistics | bifrost 中 WebServerStatistics 模块相关的变更 |
| web_server_log_watcher | bifrost 中 WebServerLogWatcher 模块相关的变更 |
| client | 组件gRPC客户端相关的变更 |
| pkg | pkg 包的变更 |
| docs | 文档类变更 |
| changelog | CHANGELOG 的变更 |
| makefile | Makefile 文件的变更 |

0 comments on commit a49e9d7

Please sign in to comment.