summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgechev/revive/formatter/severity.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-04-04 03:29:12 +0800
committerGitHub <noreply@github.com>2020-04-03 22:29:12 +0300
commit4f63f283c47dcf9e705ce5b8e8857f2b42cff8ad (patch)
treedd5dc2cae6ebae21826ffcce937533559be45a07 /vendor/github.com/mgechev/revive/formatter/severity.go
parent4af7c47b38d382d105726f9553a1a68d46882cbf (diff)
downloadgitea-4f63f283c47dcf9e705ce5b8e8857f2b42cff8ad.tar.gz
gitea-4f63f283c47dcf9e705ce5b8e8857f2b42cff8ad.zip
Rename scripts to build and add revive command as a new build tool command (#10942)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'vendor/github.com/mgechev/revive/formatter/severity.go')
-rw-r--r--vendor/github.com/mgechev/revive/formatter/severity.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/mgechev/revive/formatter/severity.go b/vendor/github.com/mgechev/revive/formatter/severity.go
new file mode 100644
index 0000000000..a43bf31923
--- /dev/null
+++ b/vendor/github.com/mgechev/revive/formatter/severity.go
@@ -0,0 +1,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
+}