-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathcommit-format.cjs
More file actions
30 lines (28 loc) · 899 Bytes
/
Copy pathcommit-format.cjs
File metadata and controls
30 lines (28 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Shared commit message parser used by commitlint (commitlint.config.cjs) and
// semantic-release (release.config.cjs). Accepts both the BigCommerce ticket-first
// format enforced by @bigcommerce/validate-commits and the legacy conventional format:
// TRAC-123: type(scope) - subject
// type(scope): TRAC-123 subject
const parserOpts = {
headerPattern: /^(?:[A-Z0-9]{2,}-\d+: )?(\w+)(?:\(([^)]*)\))?!?(?::| -) (.+)$/,
breakingHeaderPattern: /^(?:[A-Z0-9]{2,}-\d+: )?(\w+)(?:\(([^)]*)\))?!(?::| -) (.+)$/,
headerCorrespondence: ['type', 'scope', 'subject'],
};
// Union of @commitlint/config-conventional and @bigcommerce/validate-commits types
const types = [
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'license',
'meta',
'perf',
'ref',
'refactor',
'revert',
'style',
'test',
];
module.exports = { parserOpts, types };