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

Function GetFormatter

config/lint.go:26–37  ·  view source on GitHub ↗

GetFormatter returns the formatter as defined in conf

(conf *lint.Config)

Source from the content-addressed store, hash-verified

24
25// GetFormatter returns the formatter as defined in conf
26func GetFormatter(conf *lint.Config) (lint.Formatter, error) {
27 err := checkIfMinVersion(conf.MinVersion)
28 if err != nil {
29 return nil, err
30 }
31
32 format, ok := registry.GetFormatter(conf.Formatter)
33 if !ok {
34 return nil, fmt.Errorf("config error: '%s' formatter not found", conf.Formatter)
35 }
36 return format, nil
37}
38
39// GetEnabledRules forms Rule object for rules which are enabled in config
40func GetEnabledRules(conf *lint.Config) ([]lint.Rule, error) {

Callers 4

TestConfig_GetFormatterFunction · 0.92
getLinterFunction · 0.92

Calls 2

GetFormatterFunction · 0.92
checkIfMinVersionFunction · 0.85

Tested by 3

TestConfig_GetFormatterFunction · 0.74