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

Method Validate

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

Source from the content-addressed store, hash-verified

44}
45
46func (r *ScopeCharsetRule) Validate(msg lint.Commit) (*lint.Issue, bool) {
47 invalidChars, isValid := validateCharset(r.Charset, msg.Scope())
48 if isValid {
49 return nil, true
50 }
51 return lint.NewIssue(
52 "scope can only have these chars ["+r.Charset+"]",
53 "invalid characters ["+invalidChars+"]",
54 ), false
55}

Callers 2

TestScopeCharset_PassFunction · 0.95
TestScopeCharset_FailFunction · 0.95

Calls 3

NewIssueFunction · 0.92
validateCharsetFunction · 0.85
ScopeMethod · 0.65

Tested by 2

TestScopeCharset_PassFunction · 0.76
TestScopeCharset_FailFunction · 0.76