11
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2026-04-03 08:16:54 +00:00

feat: upgrade commitlint to latest version

This commit is contained in:
Wagner Santos 2024-03-28 11:38:50 -03:00
parent 5ce82f5d81
commit 2ff45dc120
17 changed files with 5447 additions and 3587 deletions

28
commitlint.config.mjs Normal file
View file

@ -0,0 +1,28 @@
/* eslint-disable import/no-extraneous-dependencies */
import { maxLineLength } from '@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}`,
]
}
export default {
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-function-rules'],
rules: {
'body-max-line-length': [0],
'function-rules/body-max-line-length': [
2,
'always',
validateBodyMaxLengthIgnoringDeps,
],
},
}