From 041eb73d2e0391463894c04c8ac938036143eba3 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 9 Sep 2015 23:43:40 -0400 Subject: [PATCH] travis: fix DCO validation for merges merged PRs do not have DCO, so do not check for them Signed-off-by: Vincent Batts --- .tools/validate.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.tools/validate.go b/.tools/validate.go index 8fee6f08..ea0e928e 100644 --- a/.tools/validate.go +++ b/.tools/validate.go @@ -16,6 +16,12 @@ import ( var DefaultRules = []ValidateRule{ func(c CommitEntry) (vr ValidateResult) { vr.CommitEntry = c + if len(strings.Split(c.Parent, " ")) > 1 { + vr.Pass = true + vr.Msg = "merge commits do not require DCO" + return vr + } + hasValid := false for _, line := range strings.Split(c.Body, "\n") { if validDCO.MatchString(line) { @@ -70,7 +76,7 @@ func main() { fmt.Println("PASS") if *flVerbose { for _, r := range vr { - if !r.Pass { + if r.Pass { fmt.Printf(" - %s\n", r.Msg) } }