File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,18 @@ module.exports = {
9191 let colonFirstIndex = headerStr . indexOf ( ":" ) ;
9292 let titleStartIndex = Math . max ( 0 , colonFirstIndex + 1 ) ;
9393 let title = headerStr . substring ( titleStartIndex , headerStr . length ) . trim ( ) ;
94- let firstWordInTitle = title . split ( ' ' ) [ 0 ] ;
95- offence = obviousWords . includes ( firstWordInTitle ) ;
94+ let titleWords = title . split ( ' ' ) ;
95+ let usedObviousWords = '' ;
96+ for ( let word of titleWords ) {
97+ if ( obviousWords . includes ( word ) ) {
98+ offence = true ;
99+ usedObviousWords = usedObviousWords + ', ' + word
100+ }
101+ }
96102
97103 return [
98104 ! offence ,
99- `Please don't use obvious words such as ${ firstWordInTitle } in the commit title`
105+ `Please don't use obvious words such as ${ usedObviousWords } in the commit title`
100106 ] ;
101107 } ,
102108
You can’t perform that action at this time.
0 commit comments