File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ func runRoot(cmd *cobra.Command, args []string) error {
5656
5757 log .Printf ("Found %v commit to check" , len (commits ))
5858
59+ faultyCommits := []plumbing.Hash {}
60+
5961 for _ , commitHash := range commits {
6062 commitObject , commitErr := repo .CommitObject (commitHash )
6163
@@ -66,8 +68,18 @@ func runRoot(cmd *cobra.Command, args []string) error {
6668 textErr := text .CheckMessageTitle (commitObject .Message )
6769
6870 if textErr != nil {
69- return textErr
71+ faultyCommits = append (faultyCommits , commitHash )
72+ }
73+ }
74+
75+ if len (faultyCommits ) != 0 {
76+ for _ , commitHash := range faultyCommits {
77+ log .Printf ("Commit %v is not conventional commit compliant" , commitHash )
7078 }
79+
80+ log .Printf ("%v of %v commits are not conventional commit compliant" , len (faultyCommits ), len (commits ))
81+
82+ return errors .New ("Not all commits are conventiontal commits, please check the commits listed above" )
7183 }
7284
7385 log .Printf ("All %v commits are conventional commit compliant" , len (commits ))
You can’t perform that action at this time.
0 commit comments