From 0da79dc2c69df41f8e9cebbd60b5af6fe023aee1 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 9 Jun 2020 12:46:47 -0500 Subject: [PATCH 1/3] Update customization.md fixes #202 --- docs/customization.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/customization.md b/docs/customization.md index b74d086957..8c82d59887 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -226,7 +226,8 @@ This is customized info [[tool.commitizen.customize.questions]] type = "list" name = "change_type" -choices = ["feature", "bug fix"] +choices = [{value = "feature", name = "feature: A new feature."}, {value = "bug fix", name = "bug fix: A bug fix."}] +# choices: ["feature", "fix"] # short version message = "Select the type of change you are committing" [[tool.commitizen.customize.questions]] @@ -244,7 +245,7 @@ message = "Do you want to add body message in commit?" | Parameter | Type | Default | Description | | ------------------ | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `question` | `dict` | `None` | Questions regarding the commit message. Detailed below. | +| `questions` | `dict` | `None` | Questions regarding the commit message. Detailed below. | | `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. | | `example` | `str` | `None` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. | | `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?" | `bump_map` | `dict` | `None` | (OPTIONAL) Dictionary mapping the extracted information to a `SemVer` increment type (`MAJOR`, `MINOR`, `PATCH`) | | `bump_pattern` | `str` | `None` | (OPTIONAL) Regex to extract information from commit (subject and body) | -#### Detailed `question` content +#### Detailed `questions` content | Parameter | Type | Default | Description | | --------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | `str` | `None` | The type of questions. Valid type: `list`, `input` and etc. [See More](https://github.com/tmbo/questionary#different-question-types) | | `name` | `str` | `None` | The key for the value answered by user. It's used in `message_template` | | `message` | `str` | `None` | Detail description for the question. | -| `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."}]`) | +| `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. | | `default` | `Any` | `None` | (OPTIONAL) The default value for this question. | | `filter` | `str` | `None` | (Optional) Validator for user's answer. **(Work in Progress)** | From 36d9024e4cf99b7d478c63a223359728c0dd0a28 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 9 Jun 2020 12:48:00 -0500 Subject: [PATCH 2/3] Update customization.md --- docs/customization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/customization.md b/docs/customization.md index 8c82d59887..22b7295ab7 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -227,7 +227,7 @@ This is customized info type = "list" name = "change_type" choices = [{value = "feature", name = "feature: A new feature."}, {value = "bug fix", name = "bug fix: A bug fix."}] -# choices: ["feature", "fix"] # short version +# choices = ["feature", "fix"] # short version message = "Select the type of change you are committing" [[tool.commitizen.customize.questions]] From 2cc2884f85393c0ce2104101219160443911b84a Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 9 Jun 2020 12:48:53 -0500 Subject: [PATCH 3/3] Update customization.md --- docs/customization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/customization.md b/docs/customization.md index 22b7295ab7..8211e9120a 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -245,7 +245,7 @@ message = "Do you want to add body message in commit?" | Parameter | Type | Default | Description | | ------------------ | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `questions` | `dict` | `None` | Questions regarding the commit message. Detailed below. | +| `questions` | `dict` | `None` | Questions regarding the commit message. Detailed below. | | `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. | | `example` | `str` | `None` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. | | `schema` | `str` | `None` | (OPTIONAL) Show the schema used. Used by `cz schema`. |