forked from kenzuya/unshackle
merge commit filtering, deduplication, granular chore parsing, and regenerate CHANGELOG.md using git-cliff.
78 lines
2.9 KiB
TOML
78 lines
2.9 KiB
TOML
# git-cliff ~ configuration file
|
|
# https://git-cliff.org/docs/configuration
|
|
|
|
[changelog]
|
|
header = """
|
|
# Changelog\n
|
|
All notable changes to this project will be documented in this file.
|
|
|
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
|
This changelog is automatically generated using [git-cliff](https://git-cliff.org).\n
|
|
"""
|
|
body = """
|
|
{% if version -%}
|
|
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
|
{% else -%}
|
|
## [Unreleased]
|
|
{% endif -%}
|
|
{% for group, commits in commits
|
|
| filter(attribute="merge_commit", value=false)
|
|
| group_by(attribute="group") %}
|
|
### {{ group | striptags | trim | upper_first }}
|
|
{% for commit in commits | unique(attribute="message") %}
|
|
- {% if commit.scope %}*{{ commit.scope }}*: {% endif %}\
|
|
{% if commit.breaking %}[**breaking**] {% endif %}\
|
|
{{ commit.message | upper_first }}\
|
|
{% endfor %}
|
|
{% endfor %}\n
|
|
"""
|
|
footer = """
|
|
{% for release in releases -%}
|
|
{% if release.version -%}
|
|
{% if release.previous.version -%}
|
|
[{{ release.version | trim_start_matches(pat="v") }}]: \
|
|
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
|
|
/compare/{{ release.previous.version }}..{{ release.version }}
|
|
{% endif -%}
|
|
{% else -%}
|
|
[unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
|
|
/compare/{{ release.previous.version }}..HEAD
|
|
{% endif -%}
|
|
{% endfor -%}
|
|
"""
|
|
trim = true
|
|
postprocessors = []
|
|
|
|
[git]
|
|
conventional_commits = true
|
|
filter_unconventional = true
|
|
split_commits = false
|
|
commit_preprocessors = [
|
|
# Strip emoji (both UTF-8 and :shortcode: styles) from commit messages
|
|
{ pattern = ' *(:\w+:|[\p{Emoji_Presentation}\p{Extended_Pictographic}]\x{FE0F}?\x{200D}?) *', replace = "" },
|
|
# Remove trailing PR/issue numbers like (#123) from commit messages
|
|
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
|
|
]
|
|
commit_parsers = [
|
|
{ message = "^feat", group = "<!-- 0 -->Features" },
|
|
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
|
|
{ message = "^revert", group = "<!-- 2 -->Reverts" },
|
|
{ message = "^docs", group = "<!-- 3 -->Documentation" },
|
|
{ message = "^perf", group = "<!-- 4 -->Performance Improvements" },
|
|
{ message = "^refactor", group = "<!-- 5 -->Changes" },
|
|
{ message = "^style", skip = true },
|
|
{ message = "^test", skip = true },
|
|
{ message = "^chore\\(release\\)", skip = true },
|
|
{ message = "^chore\\(deps.*\\)", skip = true },
|
|
{ message = "^chore\\(pr\\)", skip = true },
|
|
{ message = "^chore", group = "<!-- 6 -->Maintenance" },
|
|
{ message = "^ci", skip = true },
|
|
{ message = "^build", group = "<!-- 7 -->Builds" },
|
|
{ body = ".*security", group = "<!-- 8 -->Security" },
|
|
]
|
|
protect_breaking_commits = true
|
|
filter_commits = true
|
|
topo_order = false
|
|
sort_commits = "oldest"
|