diff options
author | dundargoc <gocdundar@gmail.com> | 2024-05-02 00:15:56 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-05-02 22:57:07 +0200 |
commit | 01e4a70d668d54a7cefa3ff53ec97e39df516265 (patch) | |
tree | 73a2320f3d21ad1e5a7072a6011ed716d953eb56 | |
parent | e5c69df679159cd56fe34d6fc66a898bed9a87d0 (diff) | |
download | rneovim-01e4a70d668d54a7cefa3ff53ec97e39df516265.tar.gz rneovim-01e4a70d668d54a7cefa3ff53ec97e39df516265.tar.bz2 rneovim-01e4a70d668d54a7cefa3ff53ec97e39df516265.zip |
build: improve git-cliff CHANGELOG output
- Sort sections according to custom preference instead of
alphabetically. It is ordered according to "most relevant" to "least
relevant" to users.
- Sort commits alphabetically
- Don't uppercase the first letter of the commit message
-rw-r--r-- | scripts/cliff.toml | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/scripts/cliff.toml b/scripts/cliff.toml index 3fc10e5d16..ac060b7796 100644 --- a/scripts/cliff.toml +++ b/scripts/cliff.toml @@ -1,4 +1,4 @@ -# configuration file for git-cliff (0.1.0) +# configuration file for git-cliff [changelog] # changelog header @@ -7,7 +7,8 @@ header = """ 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://github.com/Keats/tera +# https://keats.github.io/tera/docs/ body = """ {% if version %}\ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} @@ -15,25 +16,21 @@ body = """ ## [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ### {{ group | upper_first }} - {% for commit in commits%}\ + ### {{ group | striptags | upper_first }} + {% for commit in commits | sort(attribute="message")%}\ {% if not commit.scope %}\ - - {{ commit.message | upper_first }} + - {{ commit.message }} {% endif %}\ {% endfor %}\ {% for group, commits in commits | group_by(attribute="scope") %}\ - {% for commit in commits %}\ - - **{{commit.scope}}**: {{ commit.message | upper_first }} + {% for commit in commits | sort(attribute="message") %}\ + - **{{commit.scope}}**: {{ commit.message }} {% endfor %}\ {% endfor %} {% endfor %}\n """ # remove the leading and trailing whitespace from the template trim = true -# changelog footer -footer = """ -<!-- generated by git-cliff --> -""" [git] # parse the commits based on https://www.conventionalcommits.org @@ -48,16 +45,18 @@ commit_preprocessors = [ ] # regex for parsing and grouping commits commit_parsers = [ - { message = "!:", group = "Breaking"}, - { message = "^feat", group = "Features"}, - { message = "^fix", group = "Bug Fixes"}, - { message = "^doc", group = "Documentation"}, - { message = "^perf", group = "Performance"}, - { message = "^refactor", group = "Refactor"}, - { message = "^test", group = "Testing"}, - { message = "^chore", group = "Miscellaneous Tasks"}, - { message = "^build", group = "Build System"}, - { message = "^Revert", group = "Reverted Changes"}, + { message = "!:", group = "<!-- 0 -->Breaking"}, + { message = "^feat", group = "<!-- 1 -->Features"}, + { message = "^fix", group = "<!-- 2 -->Bug Fixes"}, + { message = "^perf", group = "<!-- 3 -->Performance"}, + { message = "^build", group = "<!-- 4 -->Build System"}, + { message = "^vim-patch", group = "<!-- 5 -->Vim patches"}, + { message = "^refactor", group = "<!-- 6 -->Refactor" }, + { message = "^ci", group = "<!-- 8 -->CI" }, + { message = "^test", group = "<!-- 9 -->Testing" }, + { message = "^docs", group = "<!-- 99 -->Documentation" }, + { message = "^revert", group = "<!-- 999 -->Reverted Changes" }, + { message = ".*", group = "<!-- 9999 -->Other"}, ] # filter out the commits that are not matched by commit parsers filter_commits = true |