Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f502e08

Browse files
author
David Arnold
authored
docs(customization): Update customization.md
fixes #202
1 parent a108872 commit f502e08

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎docs/customization.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ This is customized info
226226
[[tool.commitizen.customize.questions]]
227227
type = "list"
228228
name = "change_type"
229-
choices = ["feature", "bug fix"]
229+
choices = [{value = "feature", name = "feature: A new feature."}, {value = "bug fix", name = "bug fix: A bug fix."}]
230+
# choices = ["feature", "fix"] # short version
230231
message = "Select the type of change you are committing"
231232

232233
[[tool.commitizen.customize.questions]]
@@ -244,7 +245,7 @@ message = "Do you want to add body message in commit?"
244245

245246
| Parameter | Type | Default | Description |
246247
| ------------------ | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
247-
| `question` | `dict` | `None` | Questions regarding the commit message. Detailed below. |
248+
| `questions` | `dict` | `None` | Questions regarding the commit message. Detailed below. |
248249
| `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. |
249250
| `example` | `str` | `None` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. |
250251
| `schema` | `str` | `None` | (OPTIONAL) Show the schema used. Used by `cz schema`. |
@@ -253,13 +254,13 @@ message = "Do you want to add body message in commit?"
253254
| `bump_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the extracted information to a `SemVer` increment type (`MAJOR`, `MINOR`, `PATCH`) |
254255
| `bump_pattern` | `str` | `None` | (OPTIONAL) Regex to extract information from commit (subject and body) |
255256

256-
#### Detailed `question` content
257+
#### Detailed `questions` content
257258

258259
| Parameter | Type | Default | Description |
259260
| --------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
260261
| `type` | `str` | `None` | The type of questions. Valid type: `list`, `input` and etc. [See More](https://github.com/tmbo/questionary#different-question-types) |
261262
| `name` | `str` | `None` | The key for the value answered by user. It's used in `message_template` |
262263
| `message` | `str` | `None` | Detail description for the question. |
263-
| `choices` | `list` | `None` | (OPTIONAL) The choices when `type = choice`. It should be list of dictionaries with `name` and `value`. (e.g., `[{value = "feature", name = "feature: A new feature."}, {value = "bug fix", name = "bug fix: A bug fix."}]`) |
264+
| `choices` | `list` | `None` | (OPTIONAL) The choices when `type = list`. Either use a list of values or a list of dicitionaries with `name` and `value` keys. See examples above. |
264265
| `default` | `Any` | `None` | (OPTIONAL) The default value for this question. |
265266
| `filter` | `str` | `None` | (Optional) Validator for user's answer. **(Work in Progress)** |

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /