@@ -17,8 +17,8 @@ function load(configFile) {
17
17
}
18
18
19
19
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 ( ) ;
22
22
const config = defaultConfig ( ) ;
23
23
24
24
if ( configOverride . convention ) {
@@ -29,8 +29,22 @@ function load(configFile) {
29
29
30
30
conventionConfig . msgRegex = RegExp ( conventionOverride . commitMessageRegexPattern || conventionConfig . msgRegex ) ;
31
31
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
+ } , { } ) ;
32
39
conventionConfig . featureCommitTypes = conventionOverride . featureCommitTypes || conventionConfig . featureCommitTypes ;
33
40
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
+ } , { } ) ;
34
48
35
49
// Legacy support convention.issueRegexPattern
36
50
config . changelog . issueRegexPattern = conventionOverride . issueRegexPattern || config . changelog . issueRegexPattern ;
@@ -80,8 +94,10 @@ function defaultConfig() {
80
94
'chore' ,
81
95
'merge' ,
82
96
] ,
97
+ commitTypeDescriptions : { } ,
83
98
featureCommitTypes : [ 'feat' ] ,
84
99
commitScopes : null ,
100
+ commitScopeDescriptions : { } ,
85
101
} ,
86
102
changelog : {
87
103
commitTypes : [ 'feat' , 'fix' , 'perf' ] ,
0 commit comments