1+ # git-cliff ~ configuration file
2+ # https://git-cliff.org/docs/configuration
3+
4+ [changelog ]
5+ # template for the changelog header
6+ header = """
7+ # Changelog\n
8+ All notable changes to this project will be documented in this file.
9+
10+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
11+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
12+ """
13+ # template for the changelog body
14+ # https://keats.github.io/tera/docs/#introduction
15+ body = """
16+ {%- macro remote_url() -%}
17+ https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
18+ {%- endmacro -%}
19+
20+ {% if version -%}
21+ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
22+ {% else -%}
23+ ## [Unreleased]
24+ {% endif -%}
25+
26+ {% for group, commits in commits | group_by(attribute="group") %}
27+ ### {{ group | upper_first }}
28+ {%- for commit in commits %}
29+ - {{ commit.message | split(pat="\n ") | first | upper_first | trim }}\
30+ {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
31+ {% if commit.remote.pr_number %} in \
32+ [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
33+ {%- endif -%}
34+ {% endfor %}
35+ {% endfor %}
36+
37+ {%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
38+ ## New Contributors
39+ {%- endif -%}
40+
41+ {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
42+ * @{{ contributor.username }} made their first contribution
43+ {%- if contributor.pr_number %} in \
44+ [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
45+ {%- endif %}
46+ {%- endfor %}\n
47+ """
48+ # template for the changelog footer
49+ footer = """
50+ {%- macro remote_url() -%}
51+ https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
52+ {%- endmacro -%}
53+
54+ {% for release in releases -%}
55+ {% if release.version -%}
56+ {% if release.previous.version -%}
57+ [{{ release.version | trim_start_matches(pat="v") }}]: \
58+ {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }}
59+ {% endif -%}
60+ {% else -%}
61+ [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
62+ {% endif -%}
63+ {% endfor %}
64+ <!-- generated by git-cliff -->
65+ """
66+ # remove the leading and trailing whitespace from the templates
67+ trim = true
68+
69+ [git ]
70+ # parse the commits based on https://www.conventionalcommits.org
71+ conventional_commits = true
72+ # filter out the commits that are not conventional
73+ filter_unconventional = true
74+
75+ commit_parsers = [
76+ { message = " ^feat*" , group = " <!-- 0 -->:rocket: New features" },
77+ { message = " ^fix*" , group = " <!-- 1 -->:bug: Bug fixes" },
78+ { message = " ^perf*" , group = " <!-- 2 -->:zap: Performance" },
79+ { message = " ^chore*" , group = " <!-- 3 -->:gear: Miscellaneous" },
80+ ]
81+
82+ # filter out the commits that are not matched by commit parsers
83+ filter_commits = true
84+ # sort the tags topologically
85+ topo_order = false
86+ # sort the commits inside sections by oldest/newest order
87+ sort_commits = " newest"
0 commit comments