Repository navigation
Expand file tree
/
Copy pathcliff.toml
More file actions
217 lines (206 loc) Β· 10.7 KB
/
Copy pathcliff.toml
File metadata and controls
217 lines (206 loc) Β· 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# git-cliff ~ default 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]
# template for the changelog header
header = """
<!-- markdownlint-disable -->
<!-- eslint-disable markdown/no-missing-label-refs -->
# Changelog\n
### All notable changes to this project will be documented in this file.\n\n\n\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## π·οΈ [{{ version | trim_start_matches(pat="v") }}](https://github.com/SunriseCommunity/Solar-System/releases/tag/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [Unreleased]
{% endif %}
{% set_global has_main_prs = false %}
{% set_global main_commit_count = 0 %}
{% for commit in commits -%}
{%- set commit_first_line = commit.message | split(pat="\n") | first | trim -%}
{%- if commit_first_line is matching("^Merge pull request #[0-9]+") -%}
{% set_global has_main_prs = true %}
{%- endif -%}
{%- if not commit_first_line is matching("^Merge pull request #[0-9]+") -%}
{% set_global main_commit_count = main_commit_count + 1 %}
{%- endif -%}
{%- endfor %}
{% if has_main_prs or main_commit_count > 0 %}
### π Solar System
{% set_global shown_pr_header = false %}
{% for commit in commits -%}
{%- set commit_first_line = commit.message | split(pat="\n") | first | trim -%}
{%- if commit_first_line is matching("^Merge pull request #[0-9]+") -%}
{%- if not shown_pr_header %}
### π Pull Requests
{% set_global shown_pr_header = true %}
{% endif -%}
{%- set pr_part = commit_first_line | replace(from="Merge pull request #", to="") -%}
{%- set pr_number = pr_part | split(pat=" ") | first -%}
{%- set pr_branch = pr_part | split(pat=" from ") | last | default(value="") -%}
{%- set pr_title = pr_branch | split(pat="/") | last | replace(from="-", to=" ") | replace(from="_", to=" ") | title -%}
- {{ pr_title }}{% if commit.author.name and not commit.author.name is containing(" ") %} by @{{ commit.author.name }}{% endif %} in [#{{ pr_number }}](https://github.com/SunriseCommunity/Solar-System/pull/{{ pr_number }})
{% endif -%}
{%- endfor %}
{% if main_commit_count > 0 %}
<details>
<summary>π {{ main_commit_count }} commit(s)</summary>
{% for group, grouped_commits in commits | group_by(attribute="group") %}
#### {{ group | striptags | trim | upper_first }}
{% for commit in grouped_commits %}
{%- set commit_first_line = commit.message | split(pat="\n") | first | trim %}
{%- if not commit_first_line is matching("^Merge pull request #[0-9]+") %}
- {{ commit_first_line }} [`{{ commit.id | truncate(length=7, end="") }}`](https://github.com/SunriseCommunity/Solar-System/commit/{{ commit.id }})
{% endif -%}
{% endfor %}
{% endfor %}
</details>
{% endif %}
{% endif %}
{% for submodule_path, commits in submodule_commits %}
### {{ submodule_path | upper_first }}
{% set_global shown_pr_header = false %}
{% for commit in commits -%}
{%- set commit_first_line = commit.message | split(pat="\n") | first | trim -%}
{%- if commit_first_line is matching("^Merge pull request #[0-9]+") -%}
{%- if not shown_pr_header %}
#### π Pull Requests
{% set_global shown_pr_header = true %}
{% endif -%}
{%- set pr_part = commit_first_line | replace(from="Merge pull request #", to="") -%}
{%- set pr_number = pr_part | split(pat=" ") | first -%}
{%- set pr_branch = pr_part | split(pat=" from ") | last | default(value="") -%}
{%- set pr_title = pr_branch | split(pat="/") | last | replace(from="-", to=" ") | replace(from="_", to=" ") | title -%}
- {{ pr_title }}{% if commit.author.name and not commit.author.name is containing(" ") %} by @{{ commit.author.name }}{% endif %} in [#{{ pr_number }}](https://github.com/SunriseCommunity/{{ submodule_path }}/pull/{{ pr_number }})
{% endif -%}
{%- endfor %}
{% set_global commit_count = 0 %}
{% for commit in commits -%}
{%- set commit_first_line = commit.message | split(pat="\n") | first | trim -%}
{%- if not commit_first_line is matching("^Merge pull request #[0-9]+") -%}
{% set_global commit_count = commit_count + 1 %}
{%- endif -%}
{%- endfor %}
{% if commit_count > 0 %}
<details>
<summary>π {{ commit_count }} commit(s)</summary>
{% for group, grouped_commits in commits | group_by(attribute="group") %}
##### {{ group | striptags | trim | upper_first }}
{% for commit in grouped_commits %}
{%- set commit_first_line = commit.message | split(pat="\n") | first | trim %}
- {{ commit_first_line }} [`{{ commit.id | truncate(length=7, end="") }}`](https://github.com/SunriseCommunity/{{ submodule_path }}/commit/{{ commit.id }})
{% endfor %}
{% endfor %}
</details>
{% endif %}
{% endfor %}
{% if version %}
{% if previous.version %}
**Full Changelog**: [`{{ previous.version }}...{{ version }}`](https://github.com/SunriseCommunity/Solar-System/compare/{{ previous.version }}...{{ version }})
{% endif %}
{% else -%}
{% if previous.version %}
**Full Changelog**: [`{{ previous.version }}...HEAD`](https://github.com/SunriseCommunity/Solar-System/compare/{{ previous.version }}...HEAD)
{% endif %}
{% endif %}
"""
# template for the changelog footer
footer = """
## License
This project is licensed under the [MIT License](https://github.com/SunriseCommunity/Solar-System/blob/main/LICENSE)
*This changelog was automatically generated with [git-cliff](https://github.com/orhun/git-cliff).*
"""
# Remove leading and trailing whitespace from the changelog content
trim = true
# postprocessors
render_always = true
protect_breaking_commits = false
postprocessors = [
{ pattern = 'merge branch', replace = "[chore] Merge Branch" }, # replace merge branch commit messages
{ pattern = 'Merge branch', replace = "[chore] Merge Branch" }, # replace merge branch commit messages
{ pattern = '\[dependency\]', replace = 'test' },
# Clean up Dependabot messages - remove verbose table content
{ pattern = '\[dependency\] \[chore\] Bump the.*?with \d+ updates.*?(\n\n|\|.*?\|.*?\n)*', replace = "[dependency] Update dependencies" },
{ pattern = 'Bumps the npm-all group.*?with \d+ updates.*?(\n\n|\|.*?\|.*?\n)*', replace = "[dependency] Update npm dependencies" },
{ pattern = 'Bump the.*?group with \d+ updates.*?(\n\n|\|.*?\|.*?\n)*', replace = "[dependency] Update dependency group" },
# Clean up individual package bump messages
{ pattern = 'Bumps \[([^\]]+)\].*?from.*?to.*?(\n\n.*?)*', replace = "[dependency] Update $1" },
{ pattern = 'Bump ([a-zA-Z0-9@\-\/]+) from.*?to.*?(\n\n.*?)*', replace = "[dependency] Update $1" },
{ pattern = 'Bump ([a-zA-Z0-9@\-\/]+) to.*?(\n\n.*?)*', replace = "[dependency] Update $1" },
{ pattern = 'Bump ([a-zA-Z0-9@\-\/]+) from.*?to.*?(\n\n.*?)*', replace = "[dependency] Update $1" },
{ pattern = 'Bump ([a-zA-Z0-9@\-\/]+) to.*?(\n\n.*?)*', replace = "[dependency] Update $1" },
# Generic bump message cleanup
{ pattern = 'Bump', replace = "[dependency] Update" },
# Add emoji to submodules namings
{ pattern = '### Sunrise', replace = "### π
Sunrise" },
{ pattern = '### Sunset', replace = "### π Sunset" },
{ pattern = '### Observatory', replace = "### π Observatory" },
{ pattern = '### Sunshine', replace = "### π» Sunshine" },
]
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = false
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
use_branch_tags = false
# use branch tags to group commits
recurse_submodules = true
# recurse into submodules to find commits
commit_preprocessors = [
# Replace issue numbers
# This regex pattern matches issue references in the format "(optional text #123)"
# and replaces them with a markdown link to the issue, e.g., "[#123](<REPO>/issues/123)".
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
# Example: Check spelling of the commit with the `typos` tool.
# For more information, visit: https://github.com/crate-ci/typos
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
# If the spelling is incorrect, it will be automatically fixed.
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
]
# regex for parsing and grouping commits
# Commit parsers use emojis and HTML comments for categorization.
# This convention helps in visually distinguishing commit groups.
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->π Features" },
{ message = "^fix", group = "<!-- 1 -->π Bug Fixes" },
{ message = "^refactor", group = "<!-- 2 -->π Refactor" },
{ message = "^doc", group = "<!-- 3 -->π Documentation" },
{ message = "^perf", group = "<!-- 4 -->β‘ Performance" },
{ message = "^style", group = "<!-- 5 -->π¨ Styling" },
{ message = "^test", group = "<!-- 6 -->π§ͺ Testing" },
{ message = "^chore\\(release\\): prepare for", group = "<!-- 7 -->βοΈ Miscellaneous Tasks" },
{ message = "^chore\\(deps.*\\)", group = "<!-- 8 -->π¦ Dependencies" },
{ message = "^chore\\(pr\\)", group = "<!-- 7 -->βοΈ Miscellaneous Tasks" },
{ message = "^chore\\(pull\\)", group = "<!-- 7 -->βοΈ Miscellaneous Tasks" },
{ message = "^chore|^ci", group = "<!-- 7 -->βοΈ Miscellaneous Tasks" },
# Dependency-related commits
{ message = "^\\[dependency\\]", group = "<!-- 8 -->π¦ Dependencies" },
{ message = "^bump the.*group", group = "<!-- 8 -->π¦ Dependencies" },
{ message = "^Bump the.*group", group = "<!-- 8 -->π¦ Dependencies" },
{ message = "^Bumps.*", group = "<!-- 8 -->π¦ Dependencies" },
{ message = "^Bump [a-zA-Z0-9@\\-\\/]+", group = "<!-- 8 -->π¦ Dependencies" },
{ message = ".*npm-all.*", group = "<!-- 8 -->π¦ Dependencies" },
{ message = ".*dependabot.*", group = "<!-- 8 -->π¦ Dependencies" },
# Security-related (keep separate from general dependencies)
{ body = ".*security.*", group = "<!-- 9 -->π‘οΈ Security" },
{ message = ".*security.*", group = "<!-- 9 -->π‘οΈ Security" },
{ message = "^revert", group = "<!-- 10 -->βοΈ Revert" },
{ message = "^Merge branch", group = "<!-- 11 -->π Merge Commits" },
{ message = "^merge branch", group = "<!-- 11 -->π Merge Commits" },
{ message = ".*\\.yml", group = "<!-- 12 -->π οΈ GitHub Actions" },
{ message = ".*", group = "<!-- 13 -->πΌ Other", body = ".*" },
{ message = ".*", group = "<!-- 13 -->πΌ Other" },
]
# filter out the commits that are not matched by commit parsers
filter_commits = false
topo_order = false
sort_commits = "newest"