GetFormatter returns the formatter as defined in conf
(conf *lint.Config)
| 24 | |
| 25 | // GetFormatter returns the formatter as defined in conf |
| 26 | func 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 |
| 40 | func GetEnabledRules(conf *lint.Config) ([]lint.Rule, error) { |