woodpecker/vendor/github.com/mgechev/revive/formatter/severity.go
Lukas c28f7cb29f
Add golangci-lint (#502)
Initial part of #435
2021-11-14 21:01:54 +01:00

13 lines
422 B
Go

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
}