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

Method Validate

rule/header_trim_rule.go:17–23  ·  view source on GitHub ↗
(msg lint.Commit)

Source from the content-addressed store, hash-verified

15func (r *HeaderTrimRule) Name() string { return "header-trim" }
16func (r *HeaderTrimRule) Apply(_ lint.RuleSetting) error { return nil }
17func (r *HeaderTrimRule) Validate(msg lint.Commit) (*lint.Issue, bool) {
18 h := msg.Header()
19 if h == strings.TrimSpace(h) {
20 return nil, true
21 }
22 return lint.NewIssue("header must not have leading or trailing whitespace"), false
23}

Calls 2

NewIssueFunction · 0.92
HeaderMethod · 0.65