summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgechev/revive/formatter/severity.go
blob: a43bf31923b26092c19e4b1b731aafe53c12c952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package formatter

import "github.com/mgechev/revive/lint"

func severity(config lint.Config, failure lint.Failure) lint.Severity {
	if config, ok := config.Rules[failure.RuleName]; ok && config.Severity == lint.SeverityError {
		return lint.SeverityError
	}
	if config, ok := config.Directives[failure.RuleName]; ok && config.Severity == lint.SeverityError {
		return lint.SeverityError
	}
	return lint.SeverityWarning
}