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

Method RegisterRule

registry/registry.go:130–142  ·  view source on GitHub ↗
(cRule lint.Rule)

Source from the content-addressed store, hash-verified

128}
129
130func (reg *registry) RegisterRule(cRule lint.Rule) error {
131 reg.mut.Lock()
132 defer reg.mut.Unlock()
133
134 _, ok := reg.allRules[cRule.Name()]
135 if ok {
136 return fmt.Errorf("'%s' rule already registered", cRule.Name())
137 }
138
139 reg.allRules[cRule.Name()] = cRule
140
141 return nil
142}
143
144func (reg *registry) RegisterFormatter(format lint.Formatter) error {
145 reg.mut.Lock()

Callers 2

newRegistryFunction · 0.95
RegisterRuleFunction · 0.80

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected