Skip to content

Commit

Permalink
feat: support format "type(scope): subject"
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jan 4, 2017
1 parent d433ecd commit 418810f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/index.js
Expand Up @@ -55,8 +55,11 @@ module.exports = co.wrap(function * ({
}

commits = commits.map(commit => {
// type: subject
const re = /^([^:]+):\s+/
const match = re.exec(commit.subject)
// type(scope): subject
const reWithScope = /^([^\(]+)\(([^\)]+)\):\s+/
const match = re.exec(commit.subject) || reWithScope.exec(commit.subject)
const isReleaseMessage = (commit.subject.substring(0, 3) === '-> ') && (semver.valid(commit.subject.substr(3)))
const isSimpleTweaks = /^tweaks?$/.test(commit.subject)
if (match && match[1]) {
Expand Down

0 comments on commit 418810f

Please sign in to comment.