We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90191a0 commit cb8f88fCopy full SHA for cb8f88f
rules/shortsubject/shortsubject.go
@@ -1,6 +1,8 @@
1
package shortsubject
2
3
import (
4
+ "strings"
5
+
6
"github.com/vbatts/git-validation/git"
7
"github.com/vbatts/git-validation/validate"
8
)
@@ -22,6 +24,11 @@ func init() {
22
24
// ValidateShortSubject checks that the commit's subject is strictly less than
23
25
// 90 characters (preferably not more than 72 chars).
26
func ValidateShortSubject(r validate.Rule, c git.CommitEntry) (vr validate.Result) {
27
+ if len(strings.Split(c["parent"], " ")) > 1 {
28
+ vr.Pass = true
29
+ vr.Msg = "merge commits do not require length check"
30
+ return vr
31
+ }
32
if len(c["subject"]) >= 90 {
33
vr.Pass = false
34
vr.Msg = "commit subject exceeds 90 characters"
0 commit comments