Skip to content

Commit a745bf2

Browse files
committed
fix(cz-git): remove markBreakingChangeMode restrictions on BREAKINGCHANGE footer
link #38
1 parent 1ca6108 commit a745bf2

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎docs-zh/recipes/breakingchange.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BREAKING CHANGE: use JavaScript features not available in Node 6.
1818
```
1919

2020
## 使用配置项: `markBreakingChangeMode`
21-
> 改变 "BREAKINGCHANGE"的提问方式,询问是否需要添加 =="!"== 标识
21+
> 额外添加 "BREAKINGCHANGE"的提问,询问是否需要添加 =="!"== 标识
2222
2323
```js{6}
2424
// .commitlintrc.js
@@ -32,7 +32,7 @@ module.exports = {
3232
```
3333

3434
示例:
35-
![demo](https://user-images.githubusercontent.com/40693636/174950214-b294413c-b2b4-4e5b-9b8d-38deab9e8485.gif)
35+
![demo](https://user-images.githubusercontent.com/40693636/175775159-710b69c6-ab55-4957-9195-6f963d95ba2e.gif)
3636

3737
## 使用 commitizen CLI + cz-git
3838
可以尝试运行命令自动添加标识:

‎docs/recipes/breakingchange.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BREAKING CHANGE: use JavaScript features not available in Node 6.
1818
```
1919

2020
## Use Option: `markBreakingChangeMode`
21-
> Change "BREAKINGCHANGE" question that if you need to add the =="!"== mark in the header
21+
> Add extra "BREAKING CHANGE" question that if you need to add the =="!"== mark in the header
2222
2323
```js{6}
2424
// .commitlintrc.js
@@ -32,7 +32,7 @@ module.exports = {
3232
```
3333

3434
Demo:
35-
![demo](https://user-images.githubusercontent.com/40693636/174950214-b294413c-b2b4-4e5b-9b8d-38deab9e8485.gif)
35+
![demo](https://user-images.githubusercontent.com/40693636/175775159-710b69c6-ab55-4957-9195-6f963d95ba2e.gif)
3636

3737
## Use commitizen CLI + cz-git
3838
Try running command:

‎docs/zh/recipes/breakingchange.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BREAKING CHANGE: use JavaScript features not available in Node 6.
1818
```
1919

2020
## 使用配置项: `markBreakingChangeMode`
21-
> 改变 "BREAKINGCHANGE"的提问方式,询问是否需要添加 =="!"== 标识
21+
> 额外添加 "BREAKINGCHANGE"的提问,询问是否需要添加 =="!"== 标识
2222
2323
```js{6}
2424
// .commitlintrc.js
@@ -32,7 +32,7 @@ module.exports = {
3232
```
3333

3434
示例:
35-
![demo](https://user-images.githubusercontent.com/40693636/174950214-b294413c-b2b4-4e5b-9b8d-38deab9e8485.gif)
35+
![demo](https://user-images.githubusercontent.com/40693636/175775159-710b69c6-ab55-4957-9195-6f963d95ba2e.gif)
3636

3737
## 使用 commitizen CLI + cz-git
3838
可以尝试运行命令自动添加标识:

‎packages/cz-git/src/generator/question.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,14 @@ export const generateQuestions = (options: CommitizenGitOptions, cz: any) => {
178178
message: options.messages?.breaking,
179179
completeValue: options.defaultBody || undefined,
180180
when: (answers: Answers) => {
181-
if (options.markBreakingChangeMode === true) {
182-
return answers.markBreaking;
183-
} else if (
181+
if (
184182
options.allowBreakingChanges &&
185183
answers.type &&
186184
options.allowBreakingChanges.includes(answers.type)
187185
) {
188186
return true;
189187
} else {
190-
return false;
188+
return answers.markBreaking || false;
191189
}
192190
},
193191
transformer: (input: string) => useThemeCode(input, options.themeColorCode)

0 commit comments

Comments
 (0)