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

Method Validate

rule/empty_rules.go:21–26  ·  view source on GitHub ↗
(msg lint.Commit)

Source from the content-addressed store, hash-verified

19func (r *TypeEmptyRule) Name() string { return "type-empty" }
20func (r *TypeEmptyRule) Apply(_ lint.RuleSetting) error { return nil }
21func (r *TypeEmptyRule) Validate(msg lint.Commit) (*lint.Issue, bool) {
22 if msg.Type() != "" {
23 return nil, true
24 }
25 return lint.NewIssue("type must not be empty"), false
26}
27
28// ScopeEmptyRule validates that the commit scope is not empty.
29type ScopeEmptyRule struct{}

Callers 2

Calls 2

NewIssueFunction · 0.92
TypeMethod · 0.65

Tested by 2