From f94fd7f37564e23eddeeb168ed2f1f56e316f934 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Wed, 12 Jul 2023 13:39:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=9F=E6=88=90chan?= =?UTF-8?q?gelog=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=20test:=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=A4=E8=A1=8Ccommit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git-cliff/cliff.toml | 66 ++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/git-cliff/cliff.toml b/git-cliff/cliff.toml index 2efc83d..60ee6e2 100644 --- a/git-cliff/cliff.toml +++ b/git-cliff/cliff.toml @@ -1,33 +1,39 @@ -# configuration file for git-cliff (0.1.0) +# git-cliff ~ configuration file +# https://git-cliff.org/docs/configuration +# +# Lines starting with "#" are comments. +# Configuration options are organized into tables and keys. +# See documentation for more information on available options. [changelog] # changelog header header = """ # Changelog\n -All notable changes to this project will be documented in this file.\n """ # template for the changelog body -# https://tera.netlify.app/docs/#introduction +# https://tera.netlify.app/docs/ body = """ {% if version %}\ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} {% else %}\ ## [unreleased] {% endif %}\ -{% if previous %}\ - {% if previous.commit_id %} - [{{ previous.commit_id | truncate(length=7, end="") }}]({{ previous.commit_id }})...\ - [{{ commit_id | truncate(length=7, end="") }}]({{ commit_id }}) - {% endif %}\ -{% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ### {{ group | upper_first }} - {% for commit in commits %} - - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\ - {% for footer in commit.footers -%} - , {{ footer.token }}{{ footer.separator }}{{ footer.value }}\ - {% endfor %}\ - {% endfor %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits + | filter(attribute="scope") + | sort(attribute="scope") %} + - *({{commit.scope}})*{% if commit.breaking %} [**breaking**]{% endif %} \ + {{ commit.message | upper_first }} + {%- endfor -%} + {% raw %}\n{% endraw %}\ + {%- for commit in commits %} + {%- if commit.scope -%} + {% else -%} + - {% if commit.breaking %} [**breaking**]{% endif %} \ + {{ commit.message | upper_first }} + {% endif -%} + {% endfor -%} {% endfor %}\n """ # remove the leading and trailing whitespace from the template @@ -44,18 +50,24 @@ conventional_commits = true filter_unconventional = true # process each line of a commit as an individual commit split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))" }, +] # regex for parsing and grouping commits commit_parsers = [ - { message = "^feat", group = "Features"}, - { message = "^fix", group = "Bug Fixes"}, - { message = "^doc", group = "Documentation"}, - { message = "^perf", group = "Performance"}, - { message = "^refactor", group = "Refactor"}, - { message = "^style", group = "Styling"}, - { message = "^test", group = "Testing"}, - { message = "^chore\\(release\\): prepare for", skip = true}, - { message = "^chore", group = "Miscellaneous Tasks"}, - { body = ".*security", group = "Security"}, + { message = "^feat", group = "โ›ฐ๏ธ Features" }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^doc", group = "๐Ÿ“š Documentation" }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor", group = "๐Ÿšœ Refactor" }, + { message = "^style", group = "๐ŸŽจ Styling" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore", group = "โš™๏ธ Miscellaneous Tasks" }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, ] # protect breaking changes from being skipped due to matching a skipping commit_parser protect_breaking_commits = false @@ -70,4 +82,4 @@ ignore_tags = "" # sort the tags topologically topo_order = false # sort the commits inside sections by oldest/newest order -sort_commits = "oldest" \ No newline at end of file +sort_commits = "newest" \ No newline at end of file