@@ -44,6 +44,7 @@ pontos = ">=22.7.2"
44
44
furo = " >=2022.6.21"
45
45
lxml-stubs = " ^0.5.1"
46
46
types-paramiko = " ^3.4.0.20240205"
47
+ git-cliff = " ^2.8.0"
47
48
48
49
[tool .black ]
49
50
line-length = 80
@@ -85,3 +86,91 @@ files = "gvm"
85
86
ignore_missing_imports = true
86
87
explicit_package_bases = true
87
88
allow_redefinition = true
89
+
90
+ [tool .git-cliff .changelog ]
91
+ # template for the changelog header
92
+ header = """
93
+ # Changelog\n
94
+ All notable changes to this project will be documented in this file.
95
+
96
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
97
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
98
+ """
99
+ # template for the changelog body
100
+ # https://keats.github.io/tera/docs/#introduction
101
+ body = """
102
+ {%- macro remote_url() -%}
103
+ https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
104
+ {%- endmacro -%}
105
+
106
+ {% if version -%}
107
+ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
108
+ {% else -%}
109
+ ## [Unreleased]
110
+ {% endif -%}
111
+
112
+ {% for group, commits in commits | group_by(attribute="group") %}
113
+ ### {{ group | upper_first }}
114
+ {% for commit in commits %}
115
+ - {{ commit.message | split(pat="\n ") | first | upper_first | trim }}\
116
+ {% if commit.remote.username %} by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}){%- endif -%}
117
+ {% if commit.remote.pr_number %} in \
118
+ [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
119
+ {% elif commit.id %} in \
120
+ [{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }})\
121
+ {%- endif -%}
122
+ {% endfor %}
123
+ {% endfor -%}
124
+ """
125
+ # template for the changelog footer
126
+ footer = """
127
+ {%- macro remote_url() -%}
128
+ https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
129
+ {%- endmacro -%}
130
+
131
+ {% for release in releases %}
132
+ {% if release.version -%}
133
+ {% if release.previous.version -%}
134
+ [{{ release.version | trim_start_matches(pat="v") }}]: \
135
+ {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }}
136
+ {% endif -%}
137
+ {% else -%}
138
+ [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
139
+ {% endif -%}
140
+ {%- endfor -%}
141
+ """
142
+ # remove the leading and trailing whitespace from the templates
143
+ trim = true
144
+
145
+ [tool .git-cliff .git ]
146
+ # parse the commits based on https://www.conventionalcommits.org
147
+ conventional_commits = true
148
+ # filter out the commits that are not following the conventional commits format
149
+ filter_unconventional = false
150
+ # process each line of a commit as an individual commit
151
+ split_commits = false
152
+ # regex for preprocessing the commit messages
153
+ commit_preprocessors = [
154
+ # remove issue numbers from commits
155
+ { pattern = ' \((\w+\s)?#([0-9]+)\)' , replace = " " },
156
+ ]
157
+ # regex for parsing and grouping commits
158
+ commit_parsers = [
159
+ { message = " ^[a|A]dd" , group = " <!-- 1 -->:sparkles: Added" },
160
+ { message = " ^[c|C]hange" , group = " <!-- 2 -->:construction_worker: Changed" },
161
+ { message = " ^[f|F]ix" , group = " <!-- 3 -->:bug: Bug Fixes" },
162
+ { message = " ^[r|R]emove" , group = " <!-- 4 -->:fire: Removed" },
163
+ { message = " ^[d|D]rop" , group = " <!-- 4 -->:fire: Removed" },
164
+ { message = " ^[d|D]oc" , group = " <!-- 5 -->:books: Documentation" },
165
+ { message = " ^[t|T]est" , group = " <!-- 6 -->:white_check_mark: Testing" },
166
+ { message = " ^[c|C]hore" , group = " <!-- 7 -->:wrench: Miscellaneous" },
167
+ { message = " ^[c|C]i" , group = " <!-- 7 -->️:wrench: Miscellaneous" },
168
+ { message = " ^[m|M]isc" , group = " <!-- 7 -->:wrench: Miscellaneous" },
169
+ { message = " ^[d|D]eps" , group = " <!-- 8 -->:ship: Dependencies" },
170
+ ]
171
+ # filter out the commits that are not matched by commit parsers
172
+ filter_commits = true
173
+ # sort the tags topologically
174
+ topo_order = false
175
+ # sort the commits inside sections by oldest/newest order
176
+ sort_commits = " oldest"
0 commit comments