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

Method Apply

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

Source from the content-addressed store, hash-verified

18
19func (r *SignedOffByRule) Name() string { return "signed-off-by" }
20func (r *SignedOffByRule) Apply(s lint.RuleSetting) error {
21 if err := applyStringArg(&r.Value, r.Name(), s); err != nil {
22 return err
23 }
24 // Normalize: strip a trailing ":" so both "Signed-off-by:" and
25 // "Signed-off-by" match note tokens returned by the parser.
26 r.Value = strings.TrimSuffix(strings.TrimSpace(r.Value), ":")
27 return nil
28}
29
30func (r *SignedOffByRule) Validate(msg lint.Commit) (*lint.Issue, bool) {
31 for _, note := range msg.Notes() {

Calls 2

NameMethod · 0.95
applyStringArgFunction · 0.85