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

Function GetFormatter

config/lint.go:40–51  ·  view source on GitHub ↗

GetFormatter returns the formatter as defined in conf

(conf *lint.Config)

Source from the content-addressed store, hash-verified

38
39// GetFormatter returns the formatter as defined in conf
40func GetFormatter(conf *lint.Config) (lint.Formatter, error) {
41 err := checkIfMinVersion(conf.MinVersion)
42 if err != nil {
43 return nil, err
44 }
45
46 format, ok := registry.GetFormatter(conf.Formatter)
47 if !ok {
48 return nil, fmt.Errorf("config error: '%s' formatter not found", conf.Formatter)
49 }
50 return format, nil
51}
52
53// GetEnabledRules forms Rule object for rules which are enabled in config
54func 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