Skip to content

Commit

Permalink
feat: allow skip description and skip breaking changes (#66)
Browse files Browse the repository at this point in the history
Co-authored-by: Alfred Chow <[email protected]>
  • Loading branch information
AlfredChow2338 and bms-alfred-chow authored Sep 2, 2022
1 parent e317ed7 commit 1d71d57
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Like commitizen, you can specify the configuration of cz-conventional-changelog-
| CZ_MIN_HEADER_WIDTH | minHeaderWidth | 2 | This limits how short a commit message can be. |
| CZ_MAX_LINE_WIDTH | maxLineWidth | 100 | Commit message bodies are automatically wrapped. This decides how long the lines will be. |
| CZ_SKIP_SCOPE | skipScope | true | If scope should be used in commit messages. |
| CZ_SKIP_DESCRIPTION | skipDescription | false | If description should be used in commit messages. |
| CZ_SKIP_BREAKING | skipBreaking | false | If breaking changes should be used in commit messages. |
| | scopes | undefined | A list (JS Array) of scopes that will be available for selection. Note that adding this will change the scope field from Inquirer 'input' to 'list'. |
| CZ_TYPE | defaultType | undefined | The default type. |
| CZ_SCOPE | defaultScope | undefined | The default scope. |
Expand Down
2 changes: 2 additions & 0 deletions defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module.exports = {
types: conventionalCommitTypes,
jiraMode: true,
skipScope: true,
skipDescription: false,
skipBreaking: false,
customScope: false,
maxHeaderWidth: 72,
minHeaderWidth: 2,
Expand Down
2 changes: 2 additions & 0 deletions engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,15 @@ module.exports = function(options) {
{
type: 'input',
name: 'body',
when: !options.skipDescription,
message:
'Provide a longer description of the change: (press enter to skip)\n',
default: options.defaultBody
},
{
type: 'confirm',
name: 'isBreaking',
when: !options.skipBreaking,
message: 'Are there any breaking changes?',
default: false
},
Expand Down
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ const options = {
config.skipScope,
defaults.skipScope
),
skipDescription: getEnvOrConfig(
process.env.CZ_SKIP_DESCRIPTION,
config.skipDescription,
defaults.skipDescription
),
skipBreaking: getEnvOrConfig(
process.env.CZ_SKIP_BREAKING,
config.skipBreaking,
defaults.skipBreaking
),
customScope: getEnvOrConfig(
process.env.CZ_CUSTOM_SCOPE,
config.customScope,
Expand Down

0 comments on commit 1d71d57

Please sign in to comment.