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

Method Apply

rule/trailer_rules.go:47–55  ·  view source on GitHub ↗
(s lint.RuleSetting)

Source from the content-addressed store, hash-verified

45
46func (r *TrailerExistsRule) Name() string { return "trailer-exists" }
47func (r *TrailerExistsRule) Apply(s lint.RuleSetting) error {
48 if err := applyStringArg(&r.Value, r.Name(), s); err != nil {
49 return err
50 }
51 // Normalize: strip a trailing ":" so both "Co-authored-by:" and
52 // "Co-authored-by" match note tokens returned by the parser.
53 r.Value = strings.TrimSuffix(strings.TrimSpace(r.Value), ":")
54 return nil
55}
56
57func (r *TrailerExistsRule) Validate(msg lint.Commit) (*lint.Issue, bool) {
58 for _, note := range msg.Notes() {

Callers 2

Calls 2

NameMethod · 0.95
applyStringArgFunction · 0.85

Tested by 2