forked from deepStateMirrors/tabi
👷 chore(release): list breaking changes first in changelogs
This commit is contained in:
parent
eb3cee71f0
commit
fcd0c34d19
3 changed files with 74 additions and 17 deletions
23
cliff.toml
23
cliff.toml
|
@ -21,17 +21,31 @@ body = """
|
|||
{% if previous.version %}\
|
||||
## [{{ version | trim_start_matches(pat="v") }}](<REPO>/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||
{% else %}\
|
||||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||
## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||
{% endif %}\
|
||||
{% else %}\
|
||||
## [unreleased]
|
||||
## unreleased
|
||||
{% endif %}\
|
||||
|
||||
{% macro commit(commit) -%}
|
||||
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}{% if commit.breaking %}[**‼️BREAKING‼️**] {% endif %}\
|
||||
{% macro commit(commit, in_breaking_section=false) -%}
|
||||
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}{% if commit.breaking and not in_breaking_section %}[**‼️BREAKING‼️**] {% endif %}\
|
||||
{{ commit.message | upper_first }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))\
|
||||
{% endmacro -%}
|
||||
|
||||
{%- set breaking_header_shown = false -%}
|
||||
{% for commit in commits -%}
|
||||
{% if commit.breaking and not breaking_header_shown -%}
|
||||
{% raw %}\n### 💥 BREAKING CHANGES 💥\n{% endraw %}
|
||||
{% set_global breaking_header_shown = true %}
|
||||
{%- endif -%}
|
||||
{%- if commit.breaking -%}
|
||||
{{ self::commit(commit=commit, in_breaking_section=true) }}
|
||||
{% endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if breaking_header_shown == true -%}
|
||||
{% raw %}\n{% endraw %}\
|
||||
{%- endif -%}
|
||||
|
||||
{% for group, commits in commits | group_by(attribute="group") %}
|
||||
### {{ group | striptags | trim | upper_first }}
|
||||
{% for commit in commits
|
||||
|
@ -47,6 +61,7 @@ body = """
|
|||
{% endfor -%}
|
||||
{% endfor %}\n
|
||||
"""
|
||||
|
||||
# remove the leading and trailing whitespace from the template
|
||||
trim = true
|
||||
# changelog footer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue