Files
2026-07-28 19:57:17 +03:00

87 lines
3.3 KiB
TOML

# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
[remote.github]
owner = "zealdocs"
repo = "zeal"
# Token is read from GITHUB_TOKEN env var (gh's auth) and is needed only to
# enrich commits with PR titles and contributor info.
[changelog]
# Template docs: https://keats.github.io/tera/docs/.
body = """\
{%- if version and previous.version -%}
[Full Changelog]({{ self::diff_url() }}){% if extra and extra.milestone %} | [Resolved Issues]({{ self::remote_url() }}/milestone/{{ extra.milestone }}?closed=1){% endif %}
{% endif -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim }}
{% for commit in commits %}
- {% if commit.scope %}**{{ commit.scope }}:** {% endif %}\
{{ commit.message | split(pat="\n") | first | trim }} \
({{ self::commit_link(id=commit.id) }})\
{% endfor %}
{% endfor %}
{%- if github and github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
#### New Contributors
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
- @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
{{ self::pr_link(pr_number=contributor.pr_number) }}\
{%- endif %}
{%- endfor -%}
{%- endif -%}
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{%- macro diff_url() -%}
{{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
{%- endmacro -%}
{%- macro pr_link(pr_number) -%}
[#{{ pr_number }}]({{ self::remote_url() }}/pull/{{ pr_number }})
{%- endmacro -%}
{%- macro commit_link(id) -%}
[`{{ id | truncate(length=7, end="") }}`]({{ self::remote_url() }}/commit/{{ id }})
{%- endmacro -%}
"""
# Remove the leading and trailing whitespace from the template.
trim = true
[git]
# Parse the commits based on https://www.conventionalcommits.org.
conventional_commits = true
# Filter out the commits that are not conventional.
filter_unconventional = true
# Regex for preprocessing the commit messages.
commit_preprocessors = [
# Remove issue numbers from commits.
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
# Regex for parsing and grouping commits.
# The `<!-- N -->` prefix on each group name is a sort hack: cliff orders groups
# alphabetically, the HTML comments establish the desired numeric order, and the
# `striptags` filter in the body template strips them before display.
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->Features" },
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
{ message = "^perf", group = "<!-- 2 -->Performance" },
{ message = "^docs", group = "<!-- 3 -->Documentation" },
{ message = "^build", group = "<!-- 4 -->Build System" },
# Skipped groups (kept in git history but excluded from release notes):
{ message = "^ci", skip = true },
{ message = "^chore", skip = true },
{ message = "^refactor", skip = true },
{ message = "^style", skip = true },
{ message = "^test", skip = true },
{ message = "^revert", skip = true },
]
# Drop commits whose type doesn't match any parser above (typos, weird types).
filter_commits = true
# Always include breaking-change commits (`feat!:`, `fix!:`, etc.) even if a
# skip rule above would otherwise drop them.
protect_breaking_commits = true