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