mirror of
https://github.com/vbatts/git-validation.git
synced 2025-05-29 16:22:26 +00:00
*: comments and golint
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
07a982ff94
commit
5e74abd1b2
2 changed files with 8 additions and 1 deletions
|
@ -13,14 +13,17 @@ func init() {
|
|||
}
|
||||
|
||||
var (
|
||||
// ValidDCO is the regexp for signed off DCO
|
||||
ValidDCO = regexp.MustCompile(`^Signed-off-by: ([^<]+) <([^<>@]+@[^<>]+)>$`)
|
||||
DcoRule = validate.Rule{
|
||||
// DcoRule is the rule being registered
|
||||
DcoRule = validate.Rule{
|
||||
Name: "DCO",
|
||||
Description: "makes sure the commits are signed",
|
||||
Run: ValidateDCO,
|
||||
}
|
||||
)
|
||||
|
||||
// ValidateDCO is the ValidateRule for a git commit
|
||||
func ValidateDCO(c git.CommitEntry) (vr validate.Result) {
|
||||
vr.CommitEntry = c
|
||||
if len(strings.Split(c["parent"], " ")) > 1 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue