1
0
Fork 0
mirror of https://github.com/vbatts/git-validation.git synced 2025-06-03 02:22:28 +00:00

message_regexp: regular expression rule for messages

Fixes: #30

now you can add a regular expression to the rules to be run
i.e. `git-validation -run "dco,message_regexp='^JIRA-[0-9]+ [A-Z].*$'"`

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2017-10-09 15:49:59 -04:00
parent d9bf419b44
commit 00823a324b
Signed by: vbatts
GPG key ID: 10937E57733F1362
8 changed files with 89 additions and 10 deletions

View file

@ -20,11 +20,12 @@ var (
Name: "DCO",
Description: "makes sure the commits are signed",
Run: ValidateDCO,
Default: true,
}
)
// ValidateDCO checks that the commit has been signed off, per the DCO process
func ValidateDCO(c git.CommitEntry) (vr validate.Result) {
func ValidateDCO(r validate.Rule, c git.CommitEntry) (vr validate.Result) {
vr.CommitEntry = c
if len(strings.Split(c["parent"], " ")) > 1 {
vr.Pass = true