@@ -17,8 +17,8 @@ function load(configFile) {
1717 }
1818
1919 const configText = fs . readFileSync ( path . resolve ( configFile ) ) . toString ( ) ;
20- const configOverride = YAML . parse ( configText ) ;
21-
20+ const configOverrideDocument = YAML . parseDocument ( configText ) ;
21+ const configOverride = configOverrideDocument . toJSON ( ) ;
2222 const config = defaultConfig ( ) ;
2323
2424 if ( configOverride . convention ) {
@@ -29,8 +29,22 @@ function load(configFile) {
2929
3030 conventionConfig . msgRegex = RegExp ( conventionOverride . commitMessageRegexPattern || conventionConfig . msgRegex ) ;
3131 conventionConfig . commitTypes = conventionOverride . commitTypes || conventionConfig . commitTypes ;
32+ conventionConfig . commitTypeDescriptions = configOverrideDocument
33+ . get ( 'convention' ) . get ( 'commitTypes' )
34+ . items . reduce ( ( acc , item ) => {
35+ acc [ item . value ] = [ item . commentBefore ?. trim ( ) , item . comment ?. trim ( ) ]
36+ . filter ( Boolean ) . join ( '\n' ) || undefined ;
37+ return acc ;
38+ } , { } ) ;
3239 conventionConfig . featureCommitTypes = conventionOverride . featureCommitTypes || conventionConfig . featureCommitTypes ;
3340 conventionConfig . commitScopes = conventionOverride . commitScopes || conventionConfig . commitScopes ;
41+ conventionConfig . commitScopeDescriptions = configOverrideDocument
42+ . get ( 'convention' ) . get ( 'commitScopes' )
43+ . items . reduce ( ( acc , item ) => {
44+ acc [ item . value ] = [ item . commentBefore ?. trim ( ) , item . comment ?. trim ( ) ]
45+ . filter ( Boolean ) . join ( '\n' ) || undefined ;
46+ return acc ;
47+ } , { } ) ;
3448
3549 // Legacy support convention.issueRegexPattern
3650 config . changelog . issueRegexPattern = conventionOverride . issueRegexPattern || config . changelog . issueRegexPattern ;
@@ -80,8 +94,10 @@ function defaultConfig() {
8094 'chore' ,
8195 'merge' ,
8296 ] ,
97+ commitTypeDescriptions : { } ,
8398 featureCommitTypes : [ 'feat' ] ,
8499 commitScopes : null ,
100+ commitScopeDescriptions : { } ,
85101 } ,
86102 changelog : {
87103 commitTypes : [ 'feat' , 'fix' , 'perf' ] ,
0 commit comments