File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change
1
+ const { maxLineLength } = require ( '@commitlint/ensure' )
2
+
3
+ const bodyMaxLineLength = 100
4
+
5
+ const validateBodyMaxLengthIgnoringDeps = ( parsedCommit ) => {
6
+ const { type, scope, body } = parsedCommit
7
+ const isDepsCommit =
8
+ type === 'chore' && scope === 'release'
9
+
10
+ return [
11
+ isDepsCommit || ! body || maxLineLength ( body , bodyMaxLineLength ) ,
12
+ `body's lines must not be longer than ${ bodyMaxLineLength } ` ,
13
+ ]
14
+ }
15
+
16
+ module . exports = {
17
+ extends : [ '@commitlint/config-conventional' ] ,
18
+ plugins : [ 'commitlint-plugin-function-rules' ] ,
19
+ rules : {
20
+ 'body-max-line-length' : [ 0 ] ,
21
+ 'function-rules/body-max-line-length' : [
22
+ 2 ,
23
+ 'always' ,
24
+ validateBodyMaxLengthIgnoringDeps ,
25
+ ] ,
26
+ } ,
27
+ }
Original file line number Diff line number Diff line change 7
7
pull_request :
8
8
workflow_call :
9
9
10
- jobs :
10
+ jobs :
11
11
commitlint :
12
12
runs-on : ubuntu-latest
13
13
steps :
14
14
- uses : actions/checkout@v3
15
15
with :
16
16
fetch-depth : 0
17
17
- uses : wagoid/commitlint-github-action@v5
18
+ with :
19
+ configFile : .github/configs/commitlint.config.js
You can’t perform that action at this time.
0 commit comments