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

Method Validate

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

Source from the content-addressed store, hash-verified

53}
54
55func (r *TrailerExistsRule) Validate(msg lint.Commit) (*lint.Issue, bool) {
56 if hasTrailer(msg, r.Value) {
57 return nil, true
58 }
59 return lint.NewIssue("message must contain trailer " + r.Value), false
60}
61
62func hasTrailer(msg lint.Commit, token string) bool {
63 for i := 0; i < msg.NoteCount(); i++ {

Callers 2

Calls 2

NewIssueFunction · 0.92
hasTrailerFunction · 0.85

Tested by 2