File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /* Taken from: https://github.com/wagoid/commitlint-github-action/blob/7f0a61df502599e1f1f50880aaa7ec1e2c0592f2/commitlint.config.mjs */
2+ /* eslint-disable import/no-extraneous-dependencies */
3+ import { maxLineLength } from '@commitlint/ensure'
4+
5+ const bodyMaxLineLength = 100
6+
7+ const validateBodyMaxLengthIgnoringDeps = ( parsedCommit ) => {
8+ const { type, scope, body } = parsedCommit
9+ const isDepsCommit =
10+ type === 'chore' && ( scope === 'deps' || scope === 'deps-dev' )
11+
12+ return [
13+ isDepsCommit || ! body || maxLineLength ( body , bodyMaxLineLength ) ,
14+ `body's lines must not be longer than ${ bodyMaxLineLength } ` ,
15+ ]
16+ }
17+
18+ export default {
19+ extends : [ '@commitlint/config-conventional' ] ,
20+ plugins : [ 'commitlint-plugin-function-rules' ] ,
21+ rules : {
22+ 'body-max-line-length' : [ 0 ] ,
23+ 'function-rules/body-max-line-length' : [
24+ 2 ,
25+ 'always' ,
26+ validateBodyMaxLengthIgnoringDeps ,
27+ ] ,
28+ } ,
29+ }
Original file line number Diff line number Diff line change 2727 with :
2828 fetch-depth : 0
2929 - uses : wagoid/commitlint-github-action@7f0a61df502599e1f1f50880aaa7ec1e2c0592f2 # v6.0.1
30+ with :
31+ configFile : .github/commitlint.config.mjs
3032 lint-actions :
3133 permissions :
3234 contents : read
You can’t perform that action at this time.
0 commit comments