File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11# git-validation
22
3- A way to do per git commit validation
3+ A way to do validation on git commits.
44
55## install
66
@@ -26,14 +26,14 @@ Usage of git-validation:
2626 -v verbose
2727```
2828
29- The default rule set are all run by default:
29+ The entire default rule set is run by default:
3030``` bash
3131vbatts@valse ~ /src/vb/git-validation (master) $ git-validation -list-rules
3232" DCO" -- makes sure the commits are signed
3333" short-subject" -- commit subjects are strictly less than 90 (github ellipsis length)
3434```
3535
36- Comma delimited rules to run:
36+ Or, specify comma- delimited rules to run:
3737``` bash
3838vbatts@valse ~ /src/vb/git-validation (master) $ git-validation -run DCO,short-subject
3939 * b243ca4 " README: adding install and usage" ... PASS
@@ -91,5 +91,5 @@ Usually by putting them in their own package.
9191See [ ` ./rules/ ` ] ( ./rules/ ) .
9292Feel free to contribute more.
9393
94- Otherwise, but using ` validate ` package API directly, rules can be handed directly to the ` validate.Runner ` .
94+ Otherwise, by using ` validate ` package API directly, rules can be handed directly to the ` validate.Runner ` .
9595
Original file line number Diff line number Diff line change 2323 }
2424)
2525
26- // ValidateDCO is the ValidateRule for a git commit
26+ // ValidateDCO checks that the commit has been signed off, per the DCO process
2727func ValidateDCO (c git.CommitEntry ) (vr validate.Result ) {
2828 vr .CommitEntry = c
2929 if len (strings .Split (c ["parent" ], " " )) > 1 {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ func init() {
1919}
2020
2121// ValidateShortSubject checks that the commit's subject is strictly less than
22- // 90 characters (preferrably not more than 72 chars).
22+ // 90 characters (preferably not more than 72 chars).
2323func ValidateShortSubject (c git.CommitEntry ) (vr validate.Result ) {
2424 if len (c ["subject" ]) >= 90 {
2525 vr .Pass = false
@@ -28,7 +28,7 @@ func ValidateShortSubject(c git.CommitEntry) (vr validate.Result) {
2828 }
2929 vr .Pass = true
3030 if len (c ["subject" ]) > 72 {
31- vr .Msg = "commit subject is not more than 90 characters, but is still more than 72 chars"
31+ vr .Msg = "commit subject is under 90 characters, but is still more than 72 chars"
3232 } else {
3333 vr .Msg = "commit subject is 72 characters or less! *yay*"
3434 }
You can’t perform that action at this time.
0 commit comments