You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `questions` | `Questions` | `None` | Questions regarding the commit message. Detailed below. The type `Questions` is an alias to `Iterable[MutableMapping[str, Any]]` which is defined in `commitizen.defaults`. It expects a list of dictionaries. |
152
+
| `questions` | `Questions` | `None` | Questions regarding the commit message. Detailed below. The type `Questions` is an alias to `Iterable[MutableMapping[str, Any]]` which is defined in `commitizen.defaults`. It expects a list of dictionaries. |
153
153
| `message_template` | `str` | `None` | The template for generating message from the given answers. `message_template` should either follow [Jinja2][jinja2] formatting specification, and all the variables in this template should be defined in `name` in `questions` |
154
-
| `example` | `str` | `""` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. |
155
-
| `schema` | `str` | `""` | (OPTIONAL) Show the schema used. Used by `cz schema`. |
156
-
| `schema_pattern` | `str` | `""` | (OPTIONAL) The regular expression used to do commit message validation. Used by `cz check`. |
157
-
| `info_path` | `str` | `""` | (OPTIONAL) The path to the file that contains explanation of the commit rules. Used by `cz info`. If not provided `cz info`, will load `info` instead. |
158
-
| `info` | `str` | `""` | (OPTIONAL) Explanation of the commit rules. Used by `cz info`. |
154
+
| `example` | `str` | `""` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. |
155
+
| `schema` | `str` | `""` | (OPTIONAL) Show the schema used. Used by `cz schema`. |
156
+
| `schema_pattern` | `str` | `""` | (OPTIONAL) The regular expression used to do commit message validation. Used by `cz check`. |
157
+
| `info_path` | `str` | `""` | (OPTIONAL) The path to the file that contains explanation of the commit rules. Used by `cz info`. If not provided `cz info`, will load `info` instead. |
158
+
| `info` | `str` | `""` | (OPTIONAL) Explanation of the commit rules. Used by `cz info`. |
159
159
| `bump_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the extracted information to a `SemVer` increment type (`MAJOR`, `MINOR`, `PATCH`) |
160
160
| `bump_pattern` | `str` | `None` | (OPTIONAL) Regex to extract information from commit (subject and body) |
161
-
| `change_type_order`| `str` | `None` | (OPTIONAL) List of strings used to order the Changelog. All other types will be sorted alphabetically. Default is `["BREAKING CHANGE", "Feat", "Fix", "Refactor", "Perf"]` |
161
+
| `change_type_order`| `str` | `None` | (OPTIONAL) List of strings used to order the Changelog. All other types will be sorted alphabetically. Default is `["BREAKING CHANGE", "Feat", "Fix", "Refactor", "Perf"]` |
162
162
| `commit_parser` | `str` | `None` | (OPTIONAL) Regex to extract information used in creating changelog. [See more][changelog-spec] |
163
163
| `changelog_pattern` | `str` | `None` | (OPTIONAL) Regex to understand which commits to include in the changelog |
164
164
| `change_type_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the type of the commit to a changelog entry |
@@ -215,7 +215,7 @@ Create a Python module, for example `cz_jira.py`.
215
215
216
216
Inherit from `BaseCommitizen`, and you must define `questions` and `message`. The others are optional.
217
217
218
-
```python
218
+
```python title="cz_jira.py"
219
219
from commitizen.cz.base import BaseCommitizen
220
220
from commitizen.defaults import Questions
221
221
@@ -259,7 +259,7 @@ class JiraCz(BaseCommitizen):
259
259
260
260
The next file required is `setup.py` modified from flask version.
261
261
262
-
```python
262
+
```python title="setup.py"
263
263
from setuptools import setup
264
264
265
265
setup(
@@ -295,7 +295,7 @@ You need to define 2 parameters inside your custom `BaseCommitizen`.
295
295
296
296
Let's see an example.
297
297
298
-
```python
298
+
```python title="cz_strange.py"
299
299
from commitizen.cz.base import BaseCommitizen
300
300
301
301
@@ -315,7 +315,7 @@ cz -n cz_strange bump
315
315
### Custom changelog generator
316
316
317
317
The changelog generator should just work in a very basic manner without touching anything.
318
-
You can customize it of course, and this are the variables you need to add to your custom `BaseCommitizen`.
318
+
You can customize it of course, and the following variables are the ones you need to add to your custom `BaseCommitizen`.
@@ -326,7 +326,7 @@ You can customize it of course, and this are the variables you need to add to yo
326
326
| `changelog_hook` | `method: (full_changelog: str, partial_changelog: Optional[str]) -> str` | NO | Receives the whole and partial (if used incremental) changelog. Useful to send slack messages or notify a compliance department. Must return the full_changelog |
327
327
| `changelog_release_hook` | `method: (release: dict, tag: git.GitTag) -> dict` | NO | Receives each generated changelog release and its associated tag. Useful to enrich releases before they are rendered. Must return the update release
328
328
329
-
```python
329
+
```python title="cz_strange.py"
330
330
from commitizen.cz.base import BaseCommitizen
331
331
import chat
332
332
import compliance
@@ -376,8 +376,6 @@ class StrangeCommitizen(BaseCommitizen):
0 commit comments