Skip to content

Commit

Permalink
feat(engine): simplify questions
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil committed Jul 24, 2020
1 parent f6de576 commit bd8e137
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ module.exports = (options) => {
{
type: 'list',
name: 'type',
message: 'Select the type of change that you\'re committing:',
message: 'Type of change that you\'re committing:',
choices,
default: options.defaultType,
}, {
type: 'input',
name: 'scope',
message: 'What is the scope of this change (e.g. component or file name): (press enter to skip)',
message: 'Scope of this change, component or folder name: (enter to skip)',
default: options.defaultScope,
filter(value) {
return value.trim().toLowerCase();
},
}, {
type: 'confirm',
name: 'isEmoji',
message: 'Add Emoji by default ?',
message: 'Emoji by default ?',
default: true,
}, {
type: 'input',
name: 'emoji',
message: 'Add your own Emoji :\n',
message: 'Your own Emoji :\n',
when(answers) {
return !answers.isEmoji;
},
Expand All @@ -52,7 +52,7 @@ module.exports = (options) => {
name: 'subject',
message(answers) {
return (
`Write a short, imperative tense description of the change (max ${
`Short, imperative tense description of the change (max ${
helpers.maxSummaryLength(options, answers)
} chars):\n`
);
Expand Down Expand Up @@ -82,21 +82,21 @@ module.exports = (options) => {
type: 'input',
name: 'body',
message:
'Provide a longer description of the change: (press enter to skip)\n',
'Longer description of the change: (enter to skip)\n',
default: options.defaultBody,
},
{
type: 'confirm',
name: 'isBreaking',
message: 'Are there any breaking changes?',
message: 'Breaking changes?',
default: false,
},
{
type: 'input',
name: 'breakingBody',
default: '-',
message:
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself:\n',
'Breaking change requires a body :\n',
when(answers) {
return answers.isBreaking && !answers.body;
},
Expand All @@ -119,15 +119,15 @@ module.exports = (options) => {
{
type: 'confirm',
name: 'isIssueAffected',
message: 'Does this change affect any open issues?',
message: 'Affect any open issues?',
default: !!options.defaultIssues,
},
{
type: 'input',
name: 'issuesBody',
default: '-',
message:
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself:\n',
'If issues are closed, the commit requires a body :\n',
when(answers) {
return (
answers.isIssueAffected && !answers.body && !answers.breakingBody
Expand All @@ -137,7 +137,7 @@ module.exports = (options) => {
{
type: 'input',
name: 'issues',
message: 'Add issue references (e.g. "fix #123", "re #123".):\n',
message: 'Issue references, "fix #123", "close #123" :\n',
when(answers) {
return answers.isIssueAffected;
},
Expand Down

0 comments on commit bd8e137

Please sign in to comment.