travis: fix DCO validation for merges

merged PRs do not have DCO, so do not check for them

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2015-09-09 23:43:40 -04:00
parent 3f62423765
commit 041eb73d2e
1 changed files with 7 additions and 1 deletions

View File

@ -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)
}
}