-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cz.toml
183 lines (158 loc) · 6.09 KB
/
.cz.toml
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
# SPDX-FileCopyrightText: Copyright 2020-2023, Contributors to science-notebook-template
# SPDX-PackageHomePage: https://github.com/dmyersturnbull/science-notebook-template
# SPDX-License-Identifier: Apache-2.0
#########################################################
# Remove this file if you don't want to use commitizen
#########################################################
[tool.commitizen]
major_version_zero = true
annotated_tag = true
gpg_sign = true
version_scheme = "semver"
version_provider = "pep621"
bump_message = "chore: bump version $current_version → $new_version"
name = "cz_customize"
[tool.commitizen.customize]
example = "feat(i18n): add Japanese translation"
info = """
We use [Conventional Commits](https://www.conventionalcommits.org/) with the following types.
| Type | Label | Changelog section | semver | Description |
| ----------- | ------------------- | --------------------- | ------ | ----------------------------------- |
| `feat:` | `type: feature` | `✨ Features` | minor | Add or change a feature |
| `fix:` | `type: fix` | `🐛 Bug fixes` | patch | Fix a bug |
| `security:` | `type: security` | `🔒 Security` | minor | Security issue |
| `docs:` | `type: docs` | `📝 Documentation` | patch | Add or modify docs or examples |
| `build:` | `type: build` | `🔧 Build system` | minor | Modify build, including Docker |
| `perf:` | `type: performance` | `⚡️ Performance` | patch | Increase speed / decrease resources |
| `test:` | `type: test` | `🚨 Tests` | N/A | Add or modify tests |
| `refactor:` | `type: refactor` | ignored | N/A | Refactor source code |
| `ci:` | `type: ci` | ignored | N/A | Modify CI/CD |
| `style:` | `type: style` | ignored | N/A | Improve style of source code |
| `chore:` | `type: chore` | ignored | N/A | Change non-source code |
"""
commit_parser = """\
^\
(?P<change_type>feat|fix|security|perf|build|docs|test|refactor|ci|style|chore)\
(?:\\((?P<scope>[-a-z0-9]+)\\))?\
(?P<breaking>!)?\
: (?P<message>[^\n]+)\
.*\
"""
changelog_pattern = "^(feat|fix|security|perf|build|docs)?(!)?"
schema = """
<type>[(<scope>)][!]: <subject>
<body>
[BREAKING CHANGE: <breaking>]
[Closes: #<issue>]
[*: <author>]+
Signed-off-by: <author>
"""
# See https://lore.kernel.org/git/[email protected]/
schema_pattern = """\
(?s)"\
(feat|fix|security|perf|build|docs|test|refactor|ci|style|chore)\
(?:\\(\\([-a-z0-9]+)\\))?\
(!)?\
: ([^\n]+)\
\n?\
(?:\nBREAKING CHANGE: [^\n]+))?\
(?:\nCloses: (#\\d+))+\
(?:\n(Co-authored-by: [^\n]+))+\
(?:\n((?:Acked-by|Reviewed-by|Helped-by|Reported-by|Mentored-by|Suggested-by|CC|Noticed-by|Tested-by): [^\n]+))?\
(?:\nSigned-off-by: ([^\n]+))?\
"""
message_template = """\
{{change_type}}\
{% if scope %}{{scope | trim}}{% endif %}\
{% if breaking %}!{% endif %}\
: {{subject | trim}}\
\n{{body | trim}}\
{% if breaking != '' %}\nBREAKING CHANGE: {{breaking | trim}}{% endif %}\
{% if issues %}\
{% set issuelist = issues.split(',') %}\
{% for issue in issuelist %}\nCloses: #{{issue | trim}}{% endfor %}\
{% endif %}\
{% if trailers %}\
{% set trailerslist = trailers.split('||') %}\
{% for trailer in trailerslist %}\n{{trailer | trim}}{% endfor %}\
{% endif %}\
"""
bump_pattern = "^(feat|fix|security|perf|build|docs)"
change_type_order = [
"breaking",
"security",
"feat",
"fix",
"perf",
"build",
"docs",
"test",
"refactor",
"ci",
"style",
"chore"
]
[tool.commitizen.customize.bump_map]
breaking = "MAJOR"
feat = "MINOR"
fix = "PATCH"
security = "PATCH"
perf = "PATCH"
build = "PATCH"
docs = "PATCH"
refactor = "PATCH"
[tool.commitizen.customize.change_type_map]
security = "🔒 Security"
feat = "✨ Features"
fix = "🐛 Bug fixes"
perf = "⚡️ Performance"
build = "🔧 Build"
docs = "📚 Documentation"
refactor = "⛵ Miscellaneous"
test = "⛵ Miscellaneous"
[[tool.commitizen.customize.questions]]
type = "list"
name = "change_type"
message = "Select the type of change you are committing"
choices = [
{value = "feat", name = "feat: A new feature.", key="f"},
{value = "fix", name = "fix: A bug fix.", key="x"},
{value = "security", name = "security: An exploit fix.", key="v"},
{value = "perf", name = "perf: A performance improvement.", key="p"},
{value = "build", name = "build: A build system change.", key="b"},
{value = "test", name = "test: Add/change tests.", key="t"},
{value = "docs", name = "docs: A change to documentation.", key="d"},
{value = "refactor", name = "refactor: A code refactoring.", key="r"},
{value = "ci", name = "ci/cd: A change to CI/CD.", key="c"},
{value = "style", name = "code style: A change to code style.", key="s"},
{value = "chore", name = "chore: A change to something non-code.", key="z"},
]
[[tool.commitizen.customize.questions]]
type = "input"
name = "subject"
message = "A short, imperative summary: (lowercase and no period).\n"
[[tool.commitizen.customize.questions]]
type = "list"
name = "scope"
message = "Scope (press [enter] to skip).\n"
choices = [
{value = "", name = "[none]"},
{value = "i18n", name = "i18n: Internationalization."},
{value = "plugins", name = "plugins: Plugins."}
]
[[tool.commitizen.customize.questions]]
type = "input"
name = "body"
message = "Body. Additional information: (press [enter] to skip)\n"
[[tool.commitizen.customize.questions]]
type = "input"
name = "breaking"
message = "If a breaking change, provide details: (press [enter] to skip)\n"
[[tool.commitizen.customize.questions]]
type = "input"
name = "issues"
message = "Closed issues, separated by commas: (press [enter] to skip)\n"
[[tool.commitizen.customize.questions]]
type = "input"
name = "trailers"
message = "Git trailers, separated by '||'. Each must be in the form '<key>: <value>'; e.g., 'Reviewed-by: John Johnson <[email protected]>': (press [enter] to skip)\n"