MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / Validate

Method Validate

rule/charset_rules.go:27–36  ·  view source on GitHub ↗
(msg lint.Commit)

Source from the content-addressed store, hash-verified

25}
26
27func (r *TypeCharsetRule) Validate(msg lint.Commit) (*lint.Issue, bool) {
28 invalidChars, isValid := validateCharset(r.Charset, msg.Type())
29 if isValid {
30 return nil, true
31 }
32 return lint.NewIssue(
33 "type can only have chars ["+r.Charset+"]",
34 "invalid characters ["+invalidChars+"]",
35 ), false
36}
37
38// ScopeCharsetRule to validate charset of scope
39type ScopeCharsetRule struct{ Charset string }

Callers 2

TestTypeCharset_PassFunction · 0.95
TestTypeCharset_FailFunction · 0.95

Calls 3

NewIssueFunction · 0.92
validateCharsetFunction · 0.85
TypeMethod · 0.65

Tested by 2

TestTypeCharset_PassFunction · 0.76
TestTypeCharset_FailFunction · 0.76