Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve automated changelog formatting #1706

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ body = """
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{% endif -%}
{% endif -%}\n
{% for group, commits in commits | group_by(attribute="group") %}
{% if commits|length > 0 %}### {{ group | striptags | trim | upper_first }}{% endif -%}
{% for scope, commits in commits | filter(attribute="merge_commit", value=false) | group_by(attribute="scope") %}
{% for commit in commits %}
{% if commits|length > 0 %}### {{ group | striptags | trim | upper_first }}\n{% endif -%}
{% for scope, commits in commits | filter(attribute="merge_commit", value=false) | group_by(attribute="scope") %}{% for commit in commits %}
- {% if commit.scope != "other" %}(**{{ commit.scope }}**): {% endif %}\
{{ commit.message | upper_first }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif %}\
{% if commit.remote.pr_number %} in #{{ commit.remote.pr_number }}{%- endif -%}
{%- endfor -%}
{% endfor %}\n
{% endfor %}
{% endfor %}
{% endfor %}\n
"""
# template for the changelog footer
footer = """
Expand Down Expand Up @@ -64,6 +63,7 @@ commit_parsers = [
{ message = "^.*\\(flutter\\):", skip = true },
{ message = "^.*\\(rn\\):", skip = true },
{ message = "^docs", group = "<!-- 7 -->:books: Documentation", default_scope = "other" },
{ message = "^chore", group = "<!-- 2 -->:hammer: Misc", default_scope = "other" },
{ message = "^feat", group = "<!-- 0 -->:sparkles: New features" },
{ message = "^test", group = "<!-- 3 -->:test_tube: Testing", skip = true },
{ message = "^fix", group = "<!-- 1 -->:bug: Bug fixes" },
Expand Down
Loading