From 16fc7ca83e7a2d7a9903c26683a6fc60f65d2d8d Mon Sep 17 00:00:00 2001 From: bahdotsh Date: Wed, 30 Apr 2025 17:52:18 +0530 Subject: [PATCH] cliff update --- cliff.toml | 83 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 21 deletions(-) diff --git a/cliff.toml b/cliff.toml index 3e43a3c..dc1f9e6 100644 --- a/cliff.toml +++ b/cliff.toml @@ -8,18 +8,54 @@ All notable changes to wrkflw will be documented in this file. # Template for the changelog body body = """ -{% if version %} -## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} -{% else %} -## [unreleased] -{% endif %} +{%- macro remote_url() -%} + https://github.com/{{ bahdotsh }}/{{ wrkflw }} +{%- endmacro -%} + +{% macro print_commit(commit) -%} + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | upper_first }} - \ + ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ +{% endmacro -%} + +{% if version %}\ + {% if previous.version %}\ + ## [{{ version | trim_start_matches(pat="v") }}]\ + ({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} + {% else %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + {% endif %}\ +{% else %}\ + ## [unreleased] +{% 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 }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/bahdotsh/wrkflw/commit/{{ commit.id }})){% if commit.links %} ({% for link in commit.links %}[{{ link.text }}]({{ link.href }}){% if not loop.last %}, {% endif %}{% endfor %}){% endif %} -{% endfor %} -{% endfor %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits + | filter(attribute="scope") + | sort(attribute="scope") %} + {{ self::print_commit(commit=commit) }} + {%- endfor %} + {% for commit in commits %} + {%- if not commit.scope -%} + {{ self::print_commit(commit=commit) }} + {% endif -%} + {% endfor -%} +{% endfor -%} +{%- if github -%} +{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} + ## New Contributors โค๏ธ +{% endif %}\ +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} + * @{{ contributor.username }} made their first contribution + {%- if contributor.pr_number %} in \ + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ + {%- endif %} +{%- endfor -%} +{%- endif %} + + """ # Remove the leading and trailing whitespace from the template @@ -35,17 +71,22 @@ footer = """ conventional_commits = true filter_unconventional = true commit_parsers = [ - { message = "^feat", group = "Features", icon = "โœจ" }, - { message = "^fix", group = "Bug Fixes", icon = "๐Ÿ›" }, - { message = "^docs", group = "Documentation", icon = "๐Ÿ“š" }, - { message = "^style", group = "Styling", icon = "๐Ÿ’Ž" }, - { message = "^refactor", group = "Refactor", icon = "๐Ÿ”จ" }, - { message = "^perf", group = "Performance", icon = "๐Ÿš€" }, - { message = "^test", group = "Testing", icon = "๐Ÿงช" }, - { message = "^chore(deps)", skip = true }, - { message = "^chore(release)", skip = true }, - { message = "^chore", group = "Miscellaneous Tasks", icon = "๐Ÿงน" }, - { body = ".*security", group = "Security", icon = "๐Ÿ”’" }, + { message = "^feat", group = "โ›ฐ๏ธ Features" }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^doc", group = "๐Ÿ“š Documentation" }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor\\(clippy\\)", skip = true }, + { message = "^refactor", group = "๐Ÿšœ Refactor" }, + { message = "^style", group = "๐ŸŽจ Styling" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore\\(npm\\).*yarn\\.lock", skip = true }, + { message = "^chore|^ci", group = "โš™๏ธ Miscellaneous Tasks" }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, ] # Define the GitHub repository URL for commit links