mirror of
https://github.com/vbatts/git-validation.git
synced 2025-05-30 00:22:29 +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:
parent
d9bf419b44
commit
00823a324b
8 changed files with 89 additions and 10 deletions
|
@ -12,6 +12,7 @@ var (
|
|||
Name: "dangling-whitespace",
|
||||
Description: "checking the presence of dangling whitespaces on line endings",
|
||||
Run: ValidateDanglingWhitespace,
|
||||
Default: true,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -20,7 +21,7 @@ func init() {
|
|||
}
|
||||
|
||||
// ValidateDanglingWhitespace runs Git's check to look for whitespace errors.
|
||||
func ValidateDanglingWhitespace(c git.CommitEntry) (vr validate.Result) {
|
||||
func ValidateDanglingWhitespace(r validate.Rule, c git.CommitEntry) (vr validate.Result) {
|
||||
vr.CommitEntry = c
|
||||
vr.Msg = "commit does not have any whitespace errors"
|
||||
vr.Pass = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue