1- # git-cliff ~ configuration file
2- # https://git-cliff.org/docs/configuration
3-
1+ # ####################
2+ # # Changelog
3+ # ####################
44[changelog ]
5- # changelog header
65header = """
7- # Changelog\n
8- All notable changes to this project will be documented in this file. \n
6+ # Changelog
7+
98"""
10- # template for the changelog body
11- # https://keats.github.io/tera/docs/#introduction
129body = """
1310{% if version %}\
14- ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
11+ # [{{ version | trim_start_matches(pat="v") }}]\
12+ {% if previous %}\
13+ {% if previous.version %}\
14+ (https://github.com/dfm88/fastapi-two-factor-authentication/compare/{{ previous.version }}...{{ version }})\
15+ {% else %}\
16+ (https://github.com/dfm88/fastapi-two-factor-authentication/tree/{{ version }})\
17+ {% endif %}\
18+ {% endif %} \
19+ - ({{ timestamp | date(format="%Y-%m-%d") }})
1520{% else %}\
16- ## [unreleased]
17- {% endif %}\
18- {% if previous %}\
19- {% if previous.commit_id %}
20- [{{ previous.commit_id | truncate(length=7, end="") }}]({{ previous.commit_id }})...\
21- [{{ commit_id | truncate(length=7, end="") }}]({{ commit_id }})
22- {% endif %}\
21+ # [unreleased]
2322{% endif %}\
2423{% for group, commits in commits | group_by(attribute="group") %}
25- ### {{ group | upper_first }}
26- {% for commit in commits %}
27- - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\
28- {% for footer in commit.footers -%}
29- , {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
24+ ## {{ group | upper_first }}
25+ {% for commit in commits %}
26+ - {% if commit.scope %}\
27+ **{{commit.scope}}:** \
28+ {% endif %}\
29+ {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/dfm88/fastapi-two-factor-authentication/commit/{{ commit.id }})) - ({{ commit.author.name }})\
30+ {% if commit.body %}\
31+ \n {{ commit.body }}\
32+ {% endif %}\
33+ {% if commit.breaking %}\
34+ {% for breakingChange in commit.footers %}\
35+ \n {% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\
3036 {% endfor %}\
31- {% endfor %}
37+ {% endif %}\
38+ {% endfor %}
3239{% endfor %}\n
3340"""
34- # template for the changelog footer
41+ trim = true
3542footer = """
3643<!-- generated by git-cliff -->
3744"""
38- # remove the leading and trailing whitespace from the templates
39- trim = true
4045
4146[git ]
4247# parse the commits based on https://www.conventionalcommits.org
@@ -45,33 +50,62 @@ conventional_commits = true
4550filter_unconventional = true
4651# process each line of a commit as an individual commit
4752split_commits = false
48- # regex for parsing and grouping commits
53+ # regex for preprocessing the commit messages
54+ commit_preprocessors = [
55+ { pattern = ' \((\w+\s)?#([0-9]+)\)' , replace = " ([#${2}](https://github.com/dfm88/fastapi-two-factor-authentication/issues/${2}))" },
56+ { pattern = " Merge pull request #([0-9]+) from [^ ]+" , replace = " PR [#${1}](https://github.com/dfm88/fastapi-two-factor-authentication/pull/${1}):" },
57+ ]
4958commit_parsers = [
50- { message = " ^feat" , group = " Features" },
51- { message = " ^fix" , group = " Bug Fixes" },
52- { message = " ^doc" , group = " Documentation" },
53- { message = " ^perf" , group = " Performance" },
54- { message = " ^refactor" , group = " Refactor" },
55- { message = " ^style" , group = " Styling" },
56- { message = " ^test" , group = " Testing" },
57- { message = " ^chore\\ (deps.*\\ )" , skip = true },
58- { message = " ^chore\\ (pr\\ )" , skip = true },
59- { message = " ^chore\\ (pull\\ )" , skip = true },
60- { message = " ^chore\\ (release\\ ): prepare for" , skip = true },
61- { message = " ^chore|^ci" , group = " Miscellaneous Tasks" },
62- { body = " .*security" , group = " Security" },
59+ { message = " (?i)^feat" , group = " <!-- 0 -->🚀 Features" },
60+ { message = " (?i)^fix" , group = " <!-- 1 -->🐛 Bug Fixes" },
61+ { message = " (?i)^refactor" , group = " <!-- 2 -->🚜 Refactor" },
62+ { message = " (?i)^doc" , group = " <!-- 3 -->📚 Documentation" },
63+ { message = " (?i)^perf" , group = " <!-- 4 -->⚡ Performance" },
64+ { message = " (?i)^style" , group = " <!-- 5 -->🎨 Styling" },
65+ { message = " (?i)^test" , group = " <!-- 6 -->🧪 Testing" },
66+ { message = " (?i)^chore" , group = " <!-- 7 -->⚙️ Miscellaneous Tasks" },
67+ { body = " .*security" , group = " <!-- 8 -->🛡️ Security" },
68+ { message = " (?i)^upgrade" , group = " <!-- 9 -->⬆️ Upgrades" },
69+ { message = " (?i)^downgrade" , group = " <!-- 10 -->⬇️ Downgrades" },
70+ { message = " (?i)^revert" , group = " <!-- 11 -->⏪ Reverts" },
71+ { message = " (?i)^release" , group = " <!-- 12 -->🔖 Releases" },
72+ { message = " (?i)^bump" , group = " <!-- 13 -->📦 Bumps" },
73+ { message = " (?i)^initial" , group = " <!-- 14 -->🎉 Initial Commit" },
74+ { message = " (?i)^init" , group = " <!-- 15 -->🎉 Initial Commit" },
75+ { message = " (?i)^add" , group = " <!-- 16 -->➕ Add" },
76+ { message = " (?i)^create" , group = " <!-- 16 -->➕ Add" },
77+ { message = " (?i)^remove" , group = " <!-- 17 -->➖ Remove" },
78+ { message = " (?i)^delete" , group = " <!-- 17 -->➖ Remove" },
79+ { message = " (?i)^rename" , group = " <!-- 18 -->📝 Rename" },
80+ { message = " (?i)^move" , group = " <!-- 19 -->📂 Move" },
81+ { message = " (?i)^copy" , group = " <!-- 20 -->📋 Copy" },
82+ { message = " (?i)^fixup" , group = " <!-- 21 -->🔧 Fixup" },
83+ { message = " (?i)^wip" , group = " <!-- 22 -->🚧 WIP" },
84+ { message = " (?i)^rework" , group = " <!-- 23 -->🔨 Rework" },
85+ { message = " (?i)^cleanup" , group = " <!-- 24 -->🧹 Cleanup" },
86+ { message = " (?i)^format" , group = " <!-- 25 -->🎨 Format" },
87+ { message = " (?i)^style" , group = " <!-- 25 -->🎨 Format" },
88+ { message = " (?i)^lint" , group = " <!-- 25 -->🎨 Format" },
89+ { message = " (?i)^update" , group = " <!-- 26 -->🔄 Update" },
90+ { message = " (?i)^pin" , group = " <!-- 27 -->📌 Pin" },
91+ { message = " (?i)^unpin" , group = " <!-- 28 -->📍 Unpin" },
92+ { message = " (?i)^build" , group = " <!-- 29 -->👷 CI/CD" },
93+ { message = " .*" , group = " <!-- 30 -->📝 Other" },
94+ { message = " (?i)^merge" , group = " <!-- 31 -->🔀 Merges" },
6395]
6496# protect breaking changes from being skipped due to matching a skipping commit_parser
6597protect_breaking_commits = false
6698# filter out the commits that are not matched by commit parsers
6799filter_commits = false
68- # regex for matching git tags
69- tag_pattern = " v [0-9]. *"
100+ # glob pattern for matching git tags
101+ tag_pattern = " [0-9]*"
70102# regex for skipping tags
71- skip_tags = " v0.1.0-beta.1 "
103+ skip_tags = " "
72104# regex for ignoring tags
73105ignore_tags = " "
74106# sort the tags topologically
75107topo_order = false
76108# sort the commits inside sections by oldest/newest order
77- sort_commits = " oldest"
109+ sort_commits = " newest"
110+ # limit the number of commits included in the changelog.
111+ # limit_commits = 400
0 commit comments