mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-05 12:25:51 +08:00
15 lines
385 B
JavaScript
15 lines
385 B
JavaScript
module.exports = {
|
|
rules: {
|
|
'tbid-header': (parsed, when = 'always') => {
|
|
const matches =
|
|
typeof parsed.header === 'string' && /^\[TBID:[A-Za-z0-9]+-\d+\]\s.+/.test(parsed.header)
|
|
const negated = when === 'never'
|
|
|
|
return [
|
|
negated ? !matches : matches,
|
|
'commit message must start with [TBID:PROJECT-123] description'
|
|
]
|
|
}
|
|
}
|
|
}
|