mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 16:06:56 +00:00
27 lines
721 B
JavaScript
27 lines
721 B
JavaScript
const { maxLineLength } = require('@commitlint/ensure')
|
|
|
|
const bodyMaxLineLength = 100
|
|
|
|
const validateBodyMaxLengthIgnoringDeps = parsedCommit => {
|
|
const { type, scope, body } = parsedCommit
|
|
const isDepsCommit =
|
|
type === 'chore' && (scope === 'deps' || scope === 'deps-dev')
|
|
|
|
return [
|
|
isDepsCommit || !body || maxLineLength(body, bodyMaxLineLength),
|
|
`body's lines must not be longer than ${bodyMaxLineLength}`,
|
|
]
|
|
}
|
|
|
|
module.exports = {
|
|
extends: ['@commitlint/config-conventional'],
|
|
plugins: ['commitlint-plugin-function-rules'],
|
|
rules: {
|
|
'body-max-line-length': [0],
|
|
'function-rules/body-max-line-length': [
|
|
2,
|
|
'always',
|
|
validateBodyMaxLengthIgnoringDeps,
|
|
],
|
|
},
|
|
}
|