Skip to content

Commit

Permalink
docs: Update changelog generation to use custom sort with git-chglog …
Browse files Browse the repository at this point in the history
  • Loading branch information
barryib authored Jan 28, 2021
1 parent 84a3761 commit a8c402b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ project adheres to [Semantic Versioning](http://semver.org/).
{{ .Title }}:
{{ range .Commits -}}
{{- if .Subject -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject | upperFirst }}
{{ end -}}
{{ end }}
{{ end -}}
{{ else }}
{{ range .Unreleased.Commits -}}
{{- if .Subject -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject | upperFirst}}
{{ end -}}
{{ end }}
{{ end -}}
Expand All @@ -43,14 +43,14 @@ project adheres to [Semantic Versioning](http://semver.org/).
{{ .Title }}:
{{ range .Commits -}}
{{- if .Subject -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject | upperFirst }}
{{ end -}}
{{ end }}
{{ end -}}
{{ else }}
{{ range .Commits -}}
{{- if .Subject -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject | upperFirst }}
{{ end -}}
{{ end }}
{{ end -}}
Expand Down
10 changes: 9 additions & 1 deletion .chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ options:

commit_groups:
group_by: Type
sort_by: Type
sort_by: Custom
title_order:
- feat
- improvement
- refactor
- fix
- docs
- test
- ci
title_maps:
feat: FEATURES
fix: BUG FIXES
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ TAG_QUERY=v11.0.0..
scope ?= "minor"

changelog-unrelease:
git-chglog -o $(CHANGELOG_FILE) $(TAG_QUERY)
git-chglog --no-case -o $(CHANGELOG_FILE) $(TAG_QUERY)

changelog:
git-chglog -o $(CHANGELOG_FILE) --next-tag `$(SEMTAG) final -s $(scope) -o -f` $(TAG_QUERY)
git-chglog --no-case -o $(CHANGELOG_FILE) --next-tag `$(SEMTAG) final -s $(scope) -o -f` $(TAG_QUERY)

release:
$(SEMTAG) final -s $(scope)

0 comments on commit a8c402b

Please sign in to comment.