Commit 5011a91
committed
feat(commit): implement questions 'filter' support with evaluations
Supported APIs: Common Python, commitizen.cz.utils.* functions
Example YAML configurations:
---
commitizen:
name: cz_customize
customize:
questions:
- ...
- type: input
name: scope
message: 'Scope of the change :'
filter: 'lambda text: commitizen.cz.utils.required_validator(text, msg="! Error: Scope is required")'
default: ''
- type: input
name: subject
message: 'Title of the commit (starting in lower case and without period) :'
filter: 'lambda text: commitizen.cz.utils.required_validator(text.strip(".").strip(), msg="! Error: Title is required")'
default: ''
- type: input
name: body
message: 'Additional contextual message (Empty to skip) :'
default: 'Issue: #...'
filter: 'commitizen.cz.utils.multiple_line_breaker'
---
Signed-off-by: Adrian DC <radian.dc@gmail.com>1 parent 7258073 commit 5011a91
File tree
3 files changed
+95
-5
lines changed- commitizen/commands
- docs
- tests
3 files changed
+95
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
| 4 | + | |
2 | 5 | | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
39 | 50 | | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| 54 | + | |
43 | 55 | | |
44 | 56 | | |
45 | 57 | | |
| |||
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
92 | 110 | | |
93 | 111 | | |
94 | 112 | | |
95 | | - | |
| 113 | + | |
| 114 | + | |
96 | 115 | | |
97 | 116 | | |
98 | 117 | | |
| |||
139 | 158 | | |
140 | 159 | | |
141 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
142 | 165 | | |
143 | 166 | | |
144 | 167 | | |
| 168 | + | |
145 | 169 | | |
146 | 170 | | |
147 | 171 | | |
| |||
330 | 354 | | |
331 | 355 | | |
332 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
333 | 364 | | |
334 | 365 | | |
335 | 366 | | |
| |||
437 | 468 | | |
438 | 469 | | |
439 | 470 | | |
440 | | - | |
| 471 | + | |
441 | 472 | | |
442 | 473 | | |
443 | 474 | | |
| |||
450 | 481 | | |
451 | 482 | | |
452 | 483 | | |
453 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
454 | 496 | | |
455 | 497 | | |
456 | 498 | | |
| |||
460 | 502 | | |
461 | 503 | | |
462 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
463 | 537 | | |
464 | 538 | | |
465 | 539 | | |
| |||
0 commit comments