From 5a72666daaf0dee567036cfd22c789be3e6b11b9 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Thu, 1 Aug 2024 10:33:05 +0200 Subject: [PATCH 1/3] only add pr link if pr number is not empty Signed-off-by: Reuben Miller --- cliff.toml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cliff.toml b/cliff.toml index f43b45bb4cf..ef8590b7135 100644 --- a/cliff.toml +++ b/cliff.toml @@ -13,7 +13,9 @@ body = """ {%- endmacro -%} {%- macro pr_link(num) -%} - [#{{ num }}]({{ self::remote_url() }}/pull/{{ num }})\ + {%- if num -%} + {% raw %} {% endraw %}- [#{{ num }}]({{ self::remote_url() }}/pull/{{ num }})\ + {% endif -%} {%- endmacro -%} {% for group, commits in commits | group_by(attribute="group") %} @@ -51,11 +53,11 @@ body = """ {%- endif -%} {%- if themes -%} - - *{{ themes | join(sep="|") | replace(from="theme:", to="") }}*: {{ commit_message }} - {{ self::pr_link(num=commit.github.pr_number) }} + - *{{ themes | join(sep="|") | replace(from="theme:", to="") }}*: {{ commit_message }}{{ self::pr_link(num=commit.github.pr_number) }} {% elif commit.scope -%} - - *{{ commit.scope }}*: {{ commit_message }} - {{ self::pr_link(num=commit.github.pr_number) }} + - *{{ commit.scope }}*: {{ commit_message }}{{ self::pr_link(num=commit.github.pr_number) }} {% else -%} - - *{{ default_scope }}*: {{ commit_message }} - {{ self::pr_link(num=commit.github.pr_number) }} + - *{{ default_scope }}*: {{ commit_message }}{{ self::pr_link(num=commit.github.pr_number) }} {% endif -%} {%- endfor -%} {% endfor %} From 7d70cd801eb30582f9a8bed7918017f1d224b1c2 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Thu, 1 Aug 2024 10:33:31 +0200 Subject: [PATCH 2/3] ignore remote-tracking branch commit messages Signed-off-by: Reuben Miller --- cliff.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/cliff.toml b/cliff.toml index ef8590b7135..44f89c68602 100644 --- a/cliff.toml +++ b/cliff.toml @@ -106,6 +106,7 @@ commit_parsers = [ { message = "version bump", skip = true }, { message = "prepare for release", skip = true }, { message = "Merge branch 'main' into", skip = true }, + { message = "Merge remote-tracking branch 'origin/main' into", skip = true }, # classify commits into sections { message = "feat", group = ":rocket: Features" }, From d71da048ded934839ff72f70eb338617203ff772 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Thu, 1 Aug 2024 10:34:54 +0200 Subject: [PATCH 3/3] limit commit group matching to before colon to prevent false positives Signed-off-by: Reuben Miller --- cliff.toml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cliff.toml b/cliff.toml index 44f89c68602..bdaa51b8015 100644 --- a/cliff.toml +++ b/cliff.toml @@ -109,17 +109,16 @@ commit_parsers = [ { message = "Merge remote-tracking branch 'origin/main' into", skip = true }, # classify commits into sections - { message = "feat", group = ":rocket: Features" }, - { message = "doc", group = ":notebook: Documentation" }, - { message = "fix", group = ":bug: Bug Fixes" }, - { message = "perf", group = ":runner: Performance" }, - { message = "refactor", group = ":sailboat: Refactor" }, - { message = "style", group = ":nail_care: Styling" }, - { message = "test", group = ":mag_right: Testing" }, - { message = "ci:", group = ":mag_right: CI/CD" }, - { message = "chore", group = ":clipboard: Miscellaneous Tasks" }, + { message = "feat(\\(.+\\))?:", group = ":rocket: Features" }, + { message = "(doc|docs)(\\(.+\\))?:", group = ":notebook: Documentation" }, + { message = "fix(\\(.+\\))?:", group = ":bug: Bug Fixes" }, + { message = "perf(\\(.+\\))?:", group = ":runner: Performance" }, + { message = "(refactor|refactoring)(\\(.+\\))?:", group = ":sailboat: Refactor" }, + { message = "style(\\(.+\\))?:", group = ":nail_care: Styling" }, + { message = "(test|tests|testing)(\\(.+\\))?:", group = ":mag_right: Testing" }, + { message = "ci(\\(.+\\))?:", group = ":mag_right: CI/CD" }, + { message = "chore(\\(.+\\))?:", group = ":clipboard: Miscellaneous Tasks" }, { body = ".*security", group = ":lock: Security" }, - { message = ".*(deps|Bump).*", group = "Dependencies"}, { message = ".*", group = ":clipboard: Miscellaneous Tasks"}, ]