diff --git a/cliff.toml b/cliff.toml index 547687ace8..4eb7d28ab5 100644 --- a/cliff.toml +++ b/cliff.toml @@ -34,11 +34,11 @@ body = """ {% for group, commits in commits | group_by(attribute="group") %} - #### {{ group | upper_first }} + #### {{ group | striptags | trim }} {% for commit in commits %} {%- if not commit.remote.pr_labels or commit.remote.pr_labels is not containing("skip-release-notes") -%} - - {{ commit.message | upper_first | trim }}\ + - {% if commit.scope %}{{ commit.scope }}: {% endif %}{{ commit.message | upper_first | trim }}\ {% if commit.remote.username %} by @{{ commit.remote.username }} {% endif %} {%- if commit.remote.pr_number -%} in [#{{ commit.remote.pr_number }}]\ (https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.remote.pr_number }}) @@ -93,24 +93,16 @@ commit_preprocessors = [ { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, ] # regex for parsing and grouping commits +# the `` prefixes order the groups and are stripped in the template commit_parsers = [ + { field = "author.name", pattern = '\[bot\]$', skip = true }, { field = "github.pr_labels", pattern = "breaking", group = " Breaking changes" }, - { message = "^feat.*", group = "Added" }, - { message = "^fix:.*", group = "Fixed" }, - { message = "^doc.*:.*", group = "Documentation" }, - { message = "^style:.*", group = "Style" }, - { message = "^refactor:.*", group = "Refactor" }, - { message = "^perf:.*", group = "Performance" }, - { message = "^performance:.*", group = "Performance" }, - { message = "^.*: add", group = "Added" }, - { message = "^[a|A]dd", group = "Added" }, - { message = "^.*: support", group = "Added" }, - { message = "^.*: remove", group = "Removed" }, - { message = "^.*: delete", group = "Removed" }, - { message = "^test", group = "Fixed" }, - { message = "^.*: fix", group = "Fixed" }, - { message = "^chore|ci:", skip = true }, - { message = "^.*", group = "Changed" }, + { message = '^feat(\(.*\))?!?:', group = " Features" }, + { message = '^fix(\(.*\))?!?:', group = " Fixes" }, + { message = '^perf(\(.*\))?!?:', group = " Performance" }, + { message = '^docs(\(.*\))?!?:', group = " Documentation" }, + { message = '^(refactor|ci|chore|test)(\(.*\))?!?:', group = " Maintenance" }, + { message = ".*", group = " Other" }, ] # protect breaking changes from being skipped due to matching a skipping commit_parser protect_breaking_commits = true