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
{{ message }}
Repository navigation
Commit 1d70a09
Browse filesBrowse the repository at this point in the historyBrowse files
feat(commit): implement questions 'filter' support with handlers
Details: The 'filter' key of 'cz_customize' questions is resolved
from its string value to the matching 'commitizen.cz.utils'
handler before prompting, and unknown values raise 'NotAllowed'
---
Supported handlers:
- multiple_line_breaker
- required_validator
- required_validator_scope
- required_validator_subject_strip
- required_validator_title_strip
Example YAML configuration:
---
commitizen:
name: cz_customize
customize:
questions:
- ...
- type: input
name: scope
message: 'Scope of the change :'
filter: 'required_validator_scope'
default: ''
- type: input
name: subject
message: 'Title of the commit (starting in lower case and without period) :'
filter: 'required_validator_subject_strip'
default: ''
- type: input
name: body
message: 'Additional contextual message (Empty to skip) :'
default: 'Issue: #...'
filter: 'multiple_line_breaker'
---
Signed-off-by: Adrian DC <radian.dc@gmail.com>
Copy file name to clipboardExpand all lines: docs/customization/config_file.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,7 @@ Example:
179
179
|`message`|`str`|`None`| Detail description for the question. |
180
180
|`choices`|`list`|`None`| (OPTIONAL) The choices when `type = list` or `type = select`. 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. |
181
181
|`default`|`Any`|`None`| (OPTIONAL) The default value for this question. |
182
-
|`filter`|`str`|`None`| (OPTIONAL) Validator for user's answer. **(Work in Progress)**|
182
+
|`filter`|`str`|`None`| (OPTIONAL) Validator for user's answer. The string is the name of a `commitizen.cz.utils.NAME(answer...)` function like `multiple_line_breaker`|
183
183
|`multiline`|`bool`|`False`| (OPTIONAL) Enable multiline support when `type = input`. |
184
184
|`use_search_filter`|`bool`|`False`| (OPTIONAL) Enable search/filter functionality for list/select type questions. This allows users to type and filter through the choices. |
185
185
|`use_jk_keys`|`bool`|`True`| (OPTIONAL) Enable/disable j/k keys for navigation in list/select type questions. Set to false if you prefer arrow keys only. |
0 commit comments