Skip to content

Commit d28c095

Browse files
author
matteo_fiore
committed
docs(customization): adding information on commit_parser, changelog_pattern, change_type_map customizable fields
1 parent 3915cd3 commit d28c095

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/customization.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ info_path = "cz_customize_info.txt"
2828
info = """
2929
This is customized info
3030
"""
31+
commit_parser = "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?"
32+
changelog_pattern = "^(feature|bug fix)?(!)?"
33+
change_type_map = {"feature" = "Feat", "bug fix" = "Fix"}
3134

3235
[[tool.commitizen.customize.questions]]
3336
type = "list"
@@ -68,6 +71,9 @@ The equivalent example for a json config file:
6871
"change_type_order": ["BREAKING CHANGE", "feat", "fix", "refactor", "perf"],
6972
"info_path": "cz_customize_info.txt",
7073
"info": "This is customized info",
74+
"commit_parser": "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?",
75+
"changelog_pattern": "^(feature|bug fix)?(!)?",
76+
"change_type_map": {"feature": "Feat", "bug fix": "Fix"},
7177
"questions": [
7278
{
7379
"type": "list",
@@ -111,6 +117,11 @@ commitizen:
111117
schema: "<type>: <body>"
112118
schema_pattern: "(feature|bug fix):(\\s.*)"
113119
bump_pattern: "^(break|new|fix|hotfix)"
120+
commit_parser: "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?",
121+
changelog_pattern: "^(feature|bug fix)?(!)?",
122+
change_type_map:
123+
feature: Feat
124+
bug fix: Fix
114125
bump_map:
115126
break: MAJOR
116127
new: MINOR
@@ -150,8 +161,12 @@ commitizen:
150161
| `bump_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the extracted information to a `SemVer` increment type (`MAJOR`, `MINOR`, `PATCH`) |
151162
| `bump_pattern` | `str` | `None` | (OPTIONAL) Regex to extract information from commit (subject and body) |
152163
| `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"]` |
164+
| `commit_parser` | `str` | `None` | (OPTIONAL) Regex to extract information used in creating changelog. [See more][changelog-spec] |
165+
| `changelog_pattern` | `str` | `None` | (OPTIONAL) Regex to understand which commits to include in the changelog |
166+
| `change_type_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the type of the commit to a changelog entry |
153167

154168
[jinja2]: https://jinja.palletsprojects.com/en/2.10.x/
169+
[changelog-spec]: https://commitizen-tools.github.io/commitizen/changelog/
155170
#### Detailed `questions` content
156171

157172
| Parameter | Type | Default | Description |
@@ -170,7 +185,7 @@ commitizen:
170185
When the [`use_shortcuts`](https://commitizen-tools.github.io/commitizen/config/#settings) config option is enabled, commitizen can show and use keyboard shortcuts to select items from lists directly.
171186
For example, when using the `cz_conventional_commits` commitizen template, shortcut keys are shown when selecting the commit type. Unless otherwise defined, keyboard shortcuts will be numbered automatically.
172187
To specify keyboard shortcuts for your custom choices, provide the shortcut using the `key` parameter in dictionary form for each choice you would like to customize.
173-
188+
174189
## 2. Customize through customizing a class
175190

176191
The basic steps are:

0 commit comments

Comments
 (0)