Skip to content

Commit b0e98e1

Browse files
matteo_fioreLee-W
matteo_fiore
authored andcommitted
docs(customization): adding information on commit_parser, changelog_pattern, change_type_map customizable fields
1 parent 9906eac commit b0e98e1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/customization.md

+15
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ info_path = "cz_customize_info.txt"
2626
info = """
2727
This is customized info
2828
"""
29+
commit_parser = "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?"
30+
changelog_pattern = "^(feature|bug fix)?(!)?"
31+
change_type_map = {"feature" = "Feat", "bug fix" = "Fix"}
2932

3033
[[tool.commitizen.customize.questions]]
3134
type = "list"
@@ -66,6 +69,9 @@ The equivalent example for a json config file:
6669
"change_type_order": ["BREAKING CHANGE", "feat", "fix", "refactor", "perf"],
6770
"info_path": "cz_customize_info.txt",
6871
"info": "This is customized info",
72+
"commit_parser": "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?",
73+
"changelog_pattern": "^(feature|bug fix)?(!)?",
74+
"change_type_map": {"feature": "Feat", "bug fix": "Fix"},
6975
"questions": [
7076
{
7177
"type": "list",
@@ -109,6 +115,11 @@ commitizen:
109115
schema: "<type>: <body>"
110116
schema_pattern: "(feature|bug fix):(\\s.*)"
111117
bump_pattern: "^(break|new|fix|hotfix)"
118+
commit_parser: "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?",
119+
changelog_pattern: "^(feature|bug fix)?(!)?",
120+
change_type_map:
121+
feature: Feat
122+
bug fix: Fix
112123
bump_map:
113124
break: MAJOR
114125
new: MINOR
@@ -148,8 +159,12 @@ commitizen:
148159
| `bump_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the extracted information to a `SemVer` increment type (`MAJOR`, `MINOR`, `PATCH`) |
149160
| `bump_pattern` | `str` | `None` | (OPTIONAL) Regex to extract information from commit (subject and body) |
150161
| `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+
| `commit_parser` | `str` | `None` | (OPTIONAL) Regex to extract information used in creating changelog. [See more][changelog-spec] |
163+
| `changelog_pattern` | `str` | `None` | (OPTIONAL) Regex to understand which commits to include in the changelog |
164+
| `change_type_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the type of the commit to a changelog entry |
151165

152166
[jinja2]: https://jinja.palletsprojects.com/en/2.10.x/
167+
[changelog-spec]: https://commitizen-tools.github.io/commitizen/changelog/
153168

154169
#### Detailed `questions` content
155170

0 commit comments

Comments
 (0)