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
Copy file name to clipboardExpand all lines: docs/customization.md
+7-2
Original file line number
Diff line number
Diff line change
@@ -151,7 +151,7 @@ Example:
151
151
name = "cz_customize"
152
152
153
153
[tool.commitizen.customize]
154
-
message_template = "{change_type}: {message}"
154
+
message_template = "{{change_type}}:{% if show_message %} {{message}}{% endif %}"
155
155
example = "feature: this feature eanable customize through config file"
156
156
schema = "<type>: <body>"
157
157
bump_pattern = "^(break|new|fix|hotfix)"
@@ -171,14 +171,19 @@ message = "Select the type of change you are committing"
171
171
type = "input"
172
172
name = "message"
173
173
message = "Body."
174
+
175
+
[[tool.commitizen.customize.questions]]
176
+
type = "confirm"
177
+
name = "show_message"
178
+
message = "Do you want to add body message in commit?"
174
179
```
175
180
176
181
### Customize configuration
177
182
178
183
| Parameter | Type | Default | Description |
179
184
| --------- | ---- | ------- | ----------- |
180
185
|`question`|`dict`|`None`| Questions regarding the commit message. Detatiled below. |
181
-
|`message_template`|`str`|`None`| The template for generating message from the given answers. `message_template` should follow the pythonstringformatting specification, and all the variables in this template should be defined in `name` in `questions`. |
186
+
|`message_template`|`str`|`None`| The template for generating message from the given answers. `message_template` should either follow the [string.Template](https://docs.python.org/3/library/string.html#template-strings) or [Jinja2](https://jinja.palletsprojects.com/en/2.10.x/)formatting specification, and all the variables in this template should be defined in `name` in `questions`. Note that `Jinja2` is not installed by default. If not installed, commitizen will use `string.Template` formatting. |
182
187
|`example`|`str`|`None`| (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. |
183
188
|`schema`|`str`|`None`| (OPTIONAL) Show the schema used. Used by `cz schema`. |
184
189
|`info_path`|`str`|`None`| (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. |
0 commit comments