MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / Apply

Method Apply

lint/rule/footer_enum.go:23–31  ·  view source on GitHub ↗

Apply sets the needed argument for the rule

(setting lint.RuleSetting)

Source from the content-addressed store, hash-verified

21
22// Apply sets the needed argument for the rule
23func (r *FooterEnumRule) Apply(setting lint.RuleSetting) error {
24 err := setStringArrArg(&r.Tokens, setting.Argument)
25 if err != nil {
26 return errInvalidArg(r.Name(), err)
27 }
28 // sorting the string elements for binary search
29 sort.Strings(r.Tokens)
30 return nil
31}
32
33// Validate validates FooterEnumRule
34func (r *FooterEnumRule) Validate(msg lint.Commit) (*lint.Issue, bool) {

Callers 3

TestFooterEnum_ValidFunction · 0.95
TestFooterEnum_InvalidFunction · 0.95

Calls 3

NameMethod · 0.95
setStringArrArgFunction · 0.85
errInvalidArgFunction · 0.85

Tested by 3

TestFooterEnum_ValidFunction · 0.76
TestFooterEnum_InvalidFunction · 0.76