Skip to content

Commit

Permalink
maint/dev ~ (CommitLint) capture 'type' text with leading whitespace …
Browse files Browse the repository at this point in the history
…and/or internal '-'
  • Loading branch information
rivy committed Aug 11, 2022
1 parent 32c6373 commit c926943
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ module.exports = {
extends: ['@commitlint/config-conventional'],
parserPreset: {
parserOpts: {
headerPattern: /^(\w+)!?(?:\s*(?:[/(]([\w,/]+)[)]?))?!?\s*[~:]?\s*(.*)$/,
// headerPattern ~ tested at <https://regex101.com/r/ez7wQS/1>
headerPattern: /^(\s*\w[\w-]*)(?:\s*(?:[/(]([\w,/]+)[)]?))?!?\s*[~:]?\s*(.*)$/,
headerCorrespondence: ['type', 'scope', 'subject'],
},
},
Expand Down

0 comments on commit c926943

Please sign in to comment.