Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f8e09ac

Browse files
committed
docs(customization): update question type to Questions (from commitizen.defaults)
1 parent e51dac5 commit f8e09ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/customization.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ commitizen:
140140
141141
| Parameter | Type | Default | Description |
142142
| ------------------- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
143-
| `questions` | `dict` | `None` | Questions regarding the commit message. Detailed below. |
143+
| `questions` | `Questions` | `None` | Questions regarding the commit message. Detailed below. The type `Questions` is an alias to `Iterable[MutableMapping[str, Any]]` which is definied in `commitizen.defaults`. |
144144
| `message_template` | `str` | `None` | The template for generating message from the given answers. `message_template` should either follow [Jinja2][jinja2] formatting specification, and all the variables in this template should be defined in `name` in `questions` |
145145
| `example` | `str` | `None` | (OPTIONAL) Provide an example to help understand the style. Used by `cz example`. |
146146
| `schema` | `str` | `None` | (OPTIONAL) Show the schema used. Used by `cz schema`. |
@@ -152,6 +152,7 @@ commitizen:
152152
| `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"]` |
153153

154154
[jinja2]: https://jinja.palletsprojects.com/en/2.10.x/
155+
155156
#### Detailed `questions` content
156157

157158
| Parameter | Type | Default | Description |
@@ -162,7 +163,6 @@ commitizen:
162163
| `choices` | `list` | `None` | (OPTIONAL) The choices when `type = list`. Either use a list of values or a list of dictionaries with `name` and `value` keys. Keyboard shortcuts can be defined via `key`. See examples above. |
163164
| `default` | `Any` | `None` | (OPTIONAL) The default value for this question. |
164165
| `filter` | `str` | `None` | (Optional) Validator for user's answer. **(Work in Progress)** |
165-
166166
[different-question-types]: https://github.com/tmbo/questionary#different-question-types
167167

168168
#### Shortcut keys
@@ -194,15 +194,15 @@ See [commitizen_cz_template](https://github.com/commitizen-tools/commitizen_cz_t
194194

195195
Create a file starting with `cz_`, for example `cz_jira.py`. This prefix is used to detect the plug-in. Same method [flask uses]
196196

197-
Inherit from `BaseCommitizen`, and you must define `questions` and
198-
`message`. The others are optional.
197+
Inherit from `BaseCommitizen`, and you must define `questions` and `message`. The others are optional.
199198

200199
```python
201200
from commitizen.cz.base import BaseCommitizen
201+
from commitizen.defaults import Questions
202202
203203
class JiraCz(BaseCommitizen):
204-
205-
def questions(self) -> list:
204+
# Questions = Iterable[MutableMapping[str, Any]]
205+
def questions(self) -> Questions:
206206
"""Questions regarding the commit message."""
207207
questions = [
208208
{

0 commit comments

Comments
 (0)