From c0d2c961773056eda6a76e5526586a11155180c2 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 10 Jun 2024 08:11:46 +0100 Subject: chore: show scope in changelog (#2102) --- cliff.toml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'cliff.toml') diff --git a/cliff.toml b/cliff.toml index 8b342787..8ebeaa94 100644 --- a/cliff.toml +++ b/cliff.toml @@ -21,11 +21,28 @@ body = """ {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} ### {{ group | upper_first }} - {% for commit in commits %} - - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ - {% endfor %} + {% for commit in commits + | filter(attribute="scope") + | sort(attribute="scope") %} + - *({{commit.scope}})* {{ commit.message | upper_first }} + {%- if commit.breaking %} + {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} + {%- endif -%} + {%- endfor -%} + {% raw %}\n{% endraw %}\ + {%- for commit in commits %} + {%- if commit.scope -%} + {% else -%} + - *(No Category)* {{ commit.message | upper_first }} + {% if commit.breaking -%} + {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} + {% endif -%} + {% endif -%} + {% endfor -%} + {% raw %}\n{% endraw %}\ {% endfor %}\n """ + # remove the leading and trailing whitespace from the template trim = true # changelog footer -- cgit v1.3.1