diff --git a/README.md b/README.md index be2542c..50b4c77 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # git-validation -A way to do per git commit validation +A way to do validation on git commits. ## install @@ -26,14 +26,14 @@ Usage of git-validation: -v verbose ``` -The default rule set are all run by default: +The entire default rule set is run by default: ```bash vbatts@valse ~/src/vb/git-validation (master) $ git-validation -list-rules "DCO" -- makes sure the commits are signed "short-subject" -- commit subjects are strictly less than 90 (github ellipsis length) ``` -Comma delimited rules to run: +Or, specify comma-delimited rules to run: ```bash vbatts@valse ~/src/vb/git-validation (master) $ git-validation -run DCO,short-subject * b243ca4 "README: adding install and usage" ... PASS @@ -91,5 +91,5 @@ Usually by putting them in their own package. See [`./rules/`](./rules/). Feel free to contribute more. -Otherwise, but using `validate` package API directly, rules can be handed directly to the `validate.Runner`. +Otherwise, by using `validate` package API directly, rules can be handed directly to the `validate.Runner`. diff --git a/rules/dco/dco.go b/rules/dco/dco.go index 75184ed..6371720 100644 --- a/rules/dco/dco.go +++ b/rules/dco/dco.go @@ -23,7 +23,7 @@ var ( } ) -// ValidateDCO is the ValidateRule for a git commit +// ValidateDCO checks that the commit has been signed off, per the DCO process func ValidateDCO(c git.CommitEntry) (vr validate.Result) { vr.CommitEntry = c if len(strings.Split(c["parent"], " ")) > 1 { diff --git a/rules/shortsubject/rule.go b/rules/shortsubject/shortsubject.go similarity index 84% rename from rules/shortsubject/rule.go rename to rules/shortsubject/shortsubject.go index 64d918d..f09e884 100644 --- a/rules/shortsubject/rule.go +++ b/rules/shortsubject/shortsubject.go @@ -19,7 +19,7 @@ func init() { } // ValidateShortSubject checks that the commit's subject is strictly less than -// 90 characters (preferrably not more than 72 chars). +// 90 characters (preferably not more than 72 chars). func ValidateShortSubject(c git.CommitEntry) (vr validate.Result) { if len(c["subject"]) >= 90 { vr.Pass = false @@ -28,7 +28,7 @@ func ValidateShortSubject(c git.CommitEntry) (vr validate.Result) { } vr.Pass = true if len(c["subject"]) > 72 { - vr.Msg = "commit subject is not more than 90 characters, but is still more than 72 chars" + vr.Msg = "commit subject is under 90 characters, but is still more than 72 chars" } else { vr.Msg = "commit subject is 72 characters or less! *yay*" }