Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // RegisteredRules are the avaible validation to perform on git commits RegisteredRules = []Rule{} )
Functions ¶
func RegisterRule ¶
func RegisterRule(vr Rule)
RegisterRule includes the Rule in the avaible set to use
func SanitizeFilters ¶
SanitizeFilters takes a comma delimited list and returns the trimmend and split (on ",") items in the list
func StringsSliceContains ¶
StringsSliceContains checks for the presence of a word in string array
func StringsSliceEqual ¶
StringsSliceEqual compares two string arrays for equality
Types ¶
type Result ¶
type Result struct { CommitEntry git.CommitEntry Pass bool Msg string }
Result is the result for a single validation of a commit.
type Results ¶
type Results []Result
Results is a set of results. This is type makes it easy for the following function.
type Rule ¶
type Rule struct { Name string // short name for reference in in the `-run=...` flag Value string // value to configure for the rule (i.e. a regexp to check for in the commit message) Description string // longer Description for readability Run func(Rule, git.CommitEntry) Result Default bool // whether the registered rule is run by default }
Rule will operate over a provided git.CommitEntry, and return a result.
func FilterRules ¶
FilterRules takes a set of rules and a list of short names to include, and returns the reduced set. The comparison is case insensitive.
Some `includes` rules have values assigned to them. i.e. -run "dco,message_regexp='^JIRA-[0-9]+ [A-Z].*$'"
type Runner ¶
type Runner struct { Root string Rules []Rule Results Results Verbose bool CommitRange string // if this is empty, then it will default to FETCH_HEAD, then HEAD }
Runner is the for processing a set of rules against a range of commits