-
-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathcliff.toml
More file actions
152 lines (136 loc) · 6.77 KB
/
cliff.toml
File metadata and controls
152 lines (136 loc) · 6.77 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
## See https://git-cliff.org/docs/configuration
## Example run manually:
## git checkout release/2.025.34
## npx git-cliff -u $(git log --format=format:%H origin/release/2.025.29..origin/release/2.025.34 | tail -1)..origin/release/2.025.34 --tag 2.025.34
[changelog]
## A Tera template. See https://keats.github.io/tera/docs/#introduction
header = """
<!-- version number should be already in the releases title, no need to repeat here. -->
"""
body = """
## What's changed
{% for group, commits in commits | group_by(attribute="group") %}
<details><summary>{{ group | striptags | trim | upper_first }} ({{ commits | length }})</summary>
{% set_global commitsWithoutScope = [] %}\
{% set_global commitsWithScope = [] %}\
{% for commit in commits %}\
{% if commit.scope %}\
{% set_global commitsWithScope = commitsWithScope | concat(with=commit) %}\
{% else %}\
{% set_global commitsWithoutScope = commitsWithoutScope | concat(with=commit) %}\
{% endif %}\
{% endfor %}\
{% for commit in commitsWithScope | sort(attribute="scope") | concat(with=commitsWithoutScope) %}
- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message }}\
{% if commit.message is not containing("([#") %}\
{{" "}}([{{ commit.id | truncate(length=7, end="") }}](https://github.com/kobotoolbox/kpi/commit/{{ commit.id }}))\
{% endif %}\
{% if commit.body %}{% if commit.body is containing("📣 Summary") or commit.body is containing("📖 Description") %}\
\n {{ "> " ~ commit.body | split(pat="\n") | join(sep="\n> ") | indent(first=true) }}
{% endif %}{% endif %}\
{% endfor %}
</details>
{% endfor %}\n
"""
footer = """
****
{% set release = releases | last %}
{% if release.version -%}
{% if release.previous.version -%}
**Full Changelog**: \
https://github.com/kobotoolbox/kpi/compare/{{ release.previous.version }}..{{ release.version }}
{% endif -%}
{% endif -%}
<!-- generated by git-cliff -->
"""
## Remove leading and trailing whitespaces from the changelog's body.
trim = true
## Render body even when there are no releases to process.
render_always = true
## An array of regex based postprocessors to modify the changelog.
postprocessors = [
]
## render body even when there are no releases to process
# render_always = true
## output file path
output = "CHANGELOG.md"
[git]
## Parse commits according to the conventional commits specification. See https://www.conventionalcommits.org
conventional_commits = true
## Exclude commits that do not match the conventional commits specification.
filter_unconventional = false
## Require all commits to be conventional. Takes precedence over filter_unconventional.
require_conventional = false
## Split commits on newlines, treating each line as an individual commit.
split_commits = false
## An array of regex based parsers to modify commit messages prior to further processing.
commit_preprocessors = [
## trim leading whitespace
{ pattern = '^\s+', replace = ''},
## change auto-generated git revert message into convention-commit format
{ pattern = '(?i)^revert ', replace = 'revert: revert '},
## one-off fixes
{ pattern = "### Notes", replace = "### 💭 Notes"},
{ pattern = "### ⚠️ Note", replace = "### 💭 Notes"},
{ pattern = "Add `deployment__uuid` to asset API", replace = "test(backend): Add `deployment__uuid` to asset API"},
## trim body
{ pattern = "---------", replace = ""}, # trim divider before footer, idk why it's not in-built. E.g. https://github.com/kobotoolbox/kpi/commit/fadfc21ffd9539b1f20a57d80a77707c30bdc287
{ pattern = " +", replace = " "},
{ pattern = "\n\n\n", replace = "\n\n"},
{ pattern = '### 📣 Summary', replace = '<!-- 📣 Summary -->'},
{ pattern = '### 📖 Description', replace = '<!-- 📖 Description -->'},
{ pattern = '### 💭 Notes[\s\S]*', replace = ''},
{ pattern = '### 👀 Preview steps[\s\S]*', replace = ''},
## link PRs
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/kobotoolbox/kpi/pull/${2}))"},
## link issue trackers?
# { pattern = 'TASK-([0-9]+)', replace = "[TASK-${1}](https://www.notion.so/kobotoolbox/task-${1})"},
# { pattern = 'DEV-([0-9]+)', replace = "[DEV-${1}](https://linear.app/kobotoolbox/issue/DEV-${1})"},
## remove issue trackers!
{ pattern = 'TASK-([0-9]+)\s?', replace = ""},
{ pattern = 'DEV-([0-9]+)\s?', replace = ""},
## Check spelling of the commit message using https://github.com/crate-ci/typos.
## If the spelling is incorrect, it will be fixed automatically.
# { pattern = '.*', replace_command = 'typos --write-changes -' },
]
## Prevent commits that are breaking from being excluded by commit parsers.
protect_breaking_commits = false
## An array of regex based parsers for extracting data from the commit message. Assigns commits to groups.
## Optionally sets the commit's scope and can decide to exclude commits from further processing.
commit_parsers = [
{ message = '^[Mm]erge', skip = true },
## Interesting for users
{ message = "^feat", group = "<!-- 11 -->Features" },
{ message = "^fix", group = "<!-- 12 -->Bug Fixes" },
{ message = "^perf", group = "<!-- 13 -->Performance" },
{ message = "^doc", group = "<!-- 14 -->Documentation" },
## Interesting for maintainers
{ message = "^ci", group = "<!-- 21 -->Continous Integration" },
{ message = "^build", group = "<!-- 22 -->Build & Dependencies" },
{ message = "^test", group = "<!-- 23 -->Testing" },
{ body = ".*security", group = "<!-- 24 -->Security" },
## Generally not interesting
{ message = "^refactor", group = "<!-- 31 -->Refactor" },
{ message = "^style", group = "<!-- 32 -->Styling" },
{ message = "^chore", group = "<!-- 33 -->Chores" },
{ message = "^revert", group = "<!-- 34 -->Revert" },
{ message = ".*", group = "<!-- 35 -->Other" },
]
## Exclude commits that are not matched by any commit parser.
filter_commits = false
## An array of link parsers for extracting external references, and turning them into URLs, using regex.
link_parsers = []
## Include only the tags that belong to the current branch.
use_branch_tags = true
## Order releases topologically instead of chronologically.
topo_order = false
## Order releases topologically instead of chronologically.
topo_order_commits = true
## Order of commits in each group/release within the changelog. Allowed values: newest, oldest
sort_commits = "oldest"
## Process submodules commits
recurse_submodules = false
## Ignore the following tags as-if they didn't exist.
ignore_tags = '2.025.14' # TODO: misplaced on main branch instead of 2.025.14 branch?