Skip to content

Commit dc5969e

Browse files
authored
feat(template): add is breaking changes confirm (#68)
1 parent c6ce1ac commit dc5969e

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ format: "{{.type}}{{with .scope}}({{.}}){{end}}: {{.subject}}{{with .body}}\n\n{
165165
| name | yes | - | Unique identifier for the item. |
166166
| label | yes | - | This will be used as the label for the input field in the UI. |
167167
| type | yes | - | The type of item. Determines which UI widget is shown. See the Item Types section to see all the different options. |
168-
| group | no | - | The name of the group this item belongs to. |
168+
| group | no | - | The name of the group this item belongs to. Separates items into groups (you can think of groups as pages). |
169169
| description | no | - | A short description of the item for user guidance. This will be displayed along with the input field. |
170170

171171
#### Item Types
@@ -282,7 +282,7 @@ Properties:
282282
| key | yes | The message shown in the UI. |
283283
| value | yes | Unique identifier for the value. |
284284

285-
### Groups
285+
### Groups (Optional)
286286

287287
Group Properties:
288288

internal/config/default.go

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ package config
33
const DefaultCommitTemplate = `---
44
name: default
55
default: true
6+
groups:
7+
- name: hasbreaking
8+
depends_on:
9+
and_conditions:
10+
- parameter_name: page2.isbreaking
11+
value_equals: true
12+
- name: nobreaking
13+
depends_on:
14+
and_conditions:
15+
- parameter_name: page2.isbreaking
16+
value_equals: false
617
items:
718
- name: type
819
group: page1
@@ -38,12 +49,21 @@ items:
3849
type: string
3950
required: true
4051
trim: true
41-
- name: body
42-
group: page3
52+
- name: isbreaking
53+
group: page2
54+
label: "Are there any breaking changes?"
55+
type: boolean
56+
- name: hasbreakingbody
57+
group: hasbreaking
58+
label: "A BREAKING CHANGE commit requires a body. Provide additional contextual information about the code changes:"
59+
type: text
60+
required: true
61+
- name: nobreakingbody
62+
group: nobreaking
4363
label: "Body. Provide additional contextual information about the code changes:"
4464
type: text
4565
- name: footer
4666
group: page3
4767
label: "Footer. Information about Breaking Changes and reference issues that this commit closes:"
4868
type: text
49-
format: "{{.type}}{{with .scope}}({{.}}){{end}}: {{.subject}}{{with .body}}\n\n{{.}}{{end}}{{with .footer}}\n\n{{.}}{{end}}"`
69+
format: "{{.type}}{{with .scope}}({{.}}){{end}}: {{.subject}}{{with .hasbreakingbody}}\n\n{{.}}{{end}}{{with .nobreakingbody}}\n\n{{.}}{{end}}{{with .footer}}\n\n{{.}}{{end}}"`

0 commit comments

Comments
 (0)