Skip to content

Commit

Permalink
feat: support slash in headerPattern default options
Browse files Browse the repository at this point in the history
  • Loading branch information
noelebrun authored and bcoe committed Jan 2, 2020
1 parent df79d39 commit 93a547d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/conventional-commits-parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var _ = require('lodash')

function assignOpts (options) {
options = _.extend({
headerPattern: /^(\w*)(?:\(([\w$.\-* ]*)\))?: (.*)$/,
headerPattern: /^(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$/,
headerCorrespondence: ['type', 'scope', 'subject'],
referenceActions: [
'close',
Expand Down
9 changes: 9 additions & 0 deletions packages/conventional-commits-parser/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,13 @@ describe('sync', function () {
repository: null
}])
})

it('should parse slash in the header with default headerPattern option', () => {
var commit = 'feat(hello/world): message'
var result = conventionalCommitsParser.sync(commit)

expect(result.type).to.equal('feat')
expect(result.scope).to.equal('hello/world')
expect(result.subject).to.equal('message')
})
})

0 comments on commit 93a547d

Please sign in to comment.