1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +02:00
revive/formatter/severity.go

14 lines
422 B
Go
Raw Normal View History

2018-05-26 22:47:13 +02:00
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 {
2018-05-26 22:47:13 +02:00
return lint.SeverityError
}
return lint.SeverityWarning
}