@@ -23,7 +23,7 @@ const rules = {
2323} ;
2424
2525const configuration = {
26- string : [ 'from' , 'to' , 'extends' ] ,
26+ string : [ 'from' , 'to' , 'extends' , 'parserPreset' ] ,
2727 boolean : [ 'edit' , 'help' , 'version' , 'quiet' , 'color' ] ,
2828 alias : {
2929 c : 'color' ,
@@ -33,15 +33,17 @@ const configuration = {
3333 q : 'quiet' ,
3434 h : 'help' ,
3535 v : 'version' ,
36- x : 'extends'
36+ x : 'extends' ,
37+ p : 'parserPreset'
3738 } ,
3839 description : {
3940 color : 'toggle colored output' ,
4041 edit : 'read last commit message found in ./git/COMMIT_EDITMSG' ,
4142 extends : 'array of shareable configurations to extend' ,
4243 from : 'lower end of the commit range to lint; applies if edit=false' ,
4344 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'
4547 } ,
4648 default : {
4749 color : true ,
@@ -80,7 +82,7 @@ function main(options) {
8082 Promise . all (
8183 messages . map ( commit => {
8284 return load ( getSeed ( flags ) )
83- . then ( opts => core . lint ( commit , opts . rules ) )
85+ . then ( opts => core . lint ( commit , opts . rules , opts ) )
8486 . then ( report => {
8587 const formatted = core . format ( report , { color : flags . color } ) ;
8688
@@ -106,7 +108,9 @@ function main(options) {
106108function getSeed ( seed ) {
107109 const e = Array . isArray ( seed . extends ) ? seed . extends : [ seed . extends ] ;
108110 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 } ;
110114}
111115
112116// Start the engine
0 commit comments