TODO: improve git-cliff config

This commit is contained in:
Thomas Rupprecht 2023-05-24 19:21:49 +02:00
parent 4bb9a19f7a
commit 0d88ee76e2
1 changed files with 20 additions and 18 deletions

View File

@ -1,5 +1,9 @@
# configuration file for git-cliff # git-cliff ~ configuration file
# see https://github.com/orhun/git-cliff#configuration-file # https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.
[changelog] [changelog]
# changelog header # changelog header
@ -8,15 +12,15 @@ header = """
All notable changes to this project will be documented in this file.\n All notable changes to this project will be documented in this file.\n
""" """
# template for the changelog body # template for the changelog body
# https://tera.netlify.app/docs/#introduction # https://tera.netlify.app/docs/
body = """ body = """
{% if version %}\ {% if version %}\
## [{{ version }}](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} ## \\[[{{ version | trim_start_matches(pat="v") }}](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/{{ version }})] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\ {% else %}\
## [unreleased] ## [unreleased]
{% endif %}\ {% endif %}\
{% for group, commits in commits | group_by(attribute="group") %} {% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}\n ### {{ group | striptags | trim | upper_first }}\n
{% for commit in commits %}\ {% for commit in commits %}\
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first | trim_end }} - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first | trim_end }}
{% endfor %}\ {% endfor %}\
@ -38,24 +42,24 @@ filter_unconventional = false
split_commits = false split_commits = false
# regex for preprocessing the commit messages # regex for preprocessing the commit messages
commit_preprocessors = [ commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))" }, # replace issue numbers # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/issues/${2}))" },
] ]
# regex for parsing and grouping commits # regex for parsing and grouping commits
commit_parsers = [ commit_parsers = [
{ message = "^feat", group = "Features" }, { message = "^feat", group = "<!-- 0 -->⛰️ Features" },
{ message = "^fix", group = "Bug Fixes" }, { message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "Documentation" }, { message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "Performance" }, { message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^refactor", group = "Refactor" }, { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^style", group = "Styling" }, { message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "Testing" }, { message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true }, { message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks" }, { message = "^chore", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "Security" }, { body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^[0-9]+.[0-9]+.[0-9]+", skip = true }, { message = "^[0-9]+.[0-9]+.[0-9]+", skip = true },
{ message = "^release v0.[0-9]", skip = true }, { message = "^release v0.[0-9]", skip = true },
{ message = "^Merge branch ", skip = true }, { message = "^Merge branch ", skip = true },
{ message = ".*", group = "Other", default_scope = "other" }, { message = ".*", group = "<!-- 9 -->✳️ Other", default_scope = "uncategorized" },
] ]
# protect breaking changes from being skipped due to matching a skipping commit_parser # protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false protect_breaking_commits = false
@ -71,5 +75,3 @@ ignore_tags = ""
topo_order = false topo_order = false
# sort the commits inside sections by oldest/newest order # sort the commits inside sections by oldest/newest order
sort_commits = "oldest" sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42