@@ -23,7 +23,7 @@ const rules = {
23
23
} ;
24
24
25
25
const configuration = {
26
- string : [ 'from' , 'to' , 'extends' ] ,
26
+ string : [ 'from' , 'to' , 'extends' , 'parserPreset' ] ,
27
27
boolean : [ 'edit' , 'help' , 'version' , 'quiet' , 'color' ] ,
28
28
alias : {
29
29
c : 'color' ,
@@ -33,15 +33,17 @@ const configuration = {
33
33
q : 'quiet' ,
34
34
h : 'help' ,
35
35
v : 'version' ,
36
- x : 'extends'
36
+ x : 'extends' ,
37
+ p : 'parserPreset'
37
38
} ,
38
39
description : {
39
40
color : 'toggle colored output' ,
40
41
edit : 'read last commit message found in ./git/COMMIT_EDITMSG' ,
41
42
extends : 'array of shareable configurations to extend' ,
42
43
from : 'lower end of the commit range to lint; applies if edit=false' ,
43
44
to : 'upper end of the commit range to lint; applies if edit=false' ,
44
- quiet : 'toggle console output'
45
+ quiet : 'toggle console output' ,
46
+ parserPreset : 'preset parser'
45
47
} ,
46
48
default : {
47
49
color : true ,
@@ -80,7 +82,7 @@ function main(options) {
80
82
Promise . all (
81
83
messages . map ( commit => {
82
84
return load ( getSeed ( flags ) )
83
- . then ( opts => core . lint ( commit , opts . rules ) )
85
+ . then ( opts => core . lint ( commit , opts . rules , opts ) )
84
86
. then ( report => {
85
87
const formatted = core . format ( report , { color : flags . color } ) ;
86
88
@@ -106,7 +108,9 @@ function main(options) {
106
108
function getSeed ( seed ) {
107
109
const e = Array . isArray ( seed . extends ) ? seed . extends : [ seed . extends ] ;
108
110
const n = e . filter ( i => typeof i === 'string' ) ;
109
- return n . length > 0 ? { extends : n } : { } ;
111
+ return n . length > 0
112
+ ? { extends : n , parserPreset : seed . parserPreset }
113
+ : { parserPreset : seed . parserPreset } ;
110
114
}
111
115
112
116
// Start the engine
0 commit comments