From 41da1eb4492f43a945cdadedb44802675a5d3900 Mon Sep 17 00:00:00 2001 From: detj Date: Tue, 7 Jan 2025 11:43:30 +0530 Subject: [PATCH] chore: improve automated changelog formatting - fix and remove extra newlines that looked awful - add support for scope-less commits to show up - improve overall formatting fixes #1293 Signed-off-by: detj --- cliff.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cliff.toml b/cliff.toml index 427daa8cc..ab41279d3 100644 --- a/cliff.toml +++ b/cliff.toml @@ -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 = """ @@ -64,6 +63,7 @@ commit_parsers = [ { message = "^.*\\(flutter\\):", skip = true }, { message = "^.*\\(rn\\):", skip = true }, { message = "^docs", group = ":books: Documentation", default_scope = "other" }, + { message = "^chore", group = ":hammer: Misc", default_scope = "other" }, { message = "^feat", group = ":sparkles: New features" }, { message = "^test", group = ":test_tube: Testing", skip = true }, { message = "^fix", group = ":bug: Bug fixes" },