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

Method RegisterFormatter

registry/registry.go:144–156  ·  view source on GitHub ↗
(format lint.Formatter)

Source from the content-addressed store, hash-verified

142}
143
144func (reg *registry) RegisterFormatter(format lint.Formatter) error {
145 reg.mut.Lock()
146 defer reg.mut.Unlock()
147
148 _, ok := reg.allFormatters[format.Name()]
149 if ok {
150 return fmt.Errorf("'%s' formatter already registered", format.Name())
151 }
152
153 reg.allFormatters[format.Name()] = format
154
155 return nil
156}
157
158func (reg *registry) GetRule(name string) (lint.Rule, bool) {
159 reg.mut.Lock()

Callers 2

newRegistryFunction · 0.95
RegisterFormatterFunction · 0.80

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected