Skip to content

Commit 55f72b9

Browse files
committed
fix(commit): remove parentheses when there is no scope present
1 parent 922097b commit 55f72b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ module.exports = {
8888
width: maxLineWidth
8989
};
9090

91+
// parentheses are only needed when a scope is present
92+
var scope = answers.scope.trim();
93+
scope = scope ? '(' + answers.scope.trim() + ')' : '';
94+
9195
// Hard limit this line
92-
var head = (answers.type + '(' + answers.scope.trim() + '): ' + answers.subject.trim()).slice(0, maxLineWidth);
96+
var head = (answers.type + scope + ': ' + answers.subject.trim()).slice(0, maxLineWidth);
9397

9498
// Wrap these lines at 100 characters
9599
var body = wrap(answers.body, wrapOptions);

0 commit comments

Comments
 (0)