From 29c496ef7b1b09b05bdbab7714a560ad34672986 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 22 Jun 2021 19:15:18 +0200 Subject: [PATCH] revive: add enable-all-rules. --- pkg/config/linters_settings.go | 1 + pkg/golinters/revive.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index 3ee1854f6a13..7487bbaef974 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -376,6 +376,7 @@ type ReviveSettings struct { IgnoreGeneratedHeader bool `mapstructure:"ignore-generated-header"` Confidence float64 Severity string + EnableAllRules bool `mapstructure:"enable-all-rules"` Rules []struct { Name string Arguments []interface{} diff --git a/pkg/golinters/revive.go b/pkg/golinters/revive.go index 182013c82643..fa8dbd9b76aa 100644 --- a/pkg/golinters/revive.go +++ b/pkg/golinters/revive.go @@ -27,7 +27,7 @@ const reviveName = "revive" var reviveDebugf = logutils.Debug("revive") -// jsonObject defines a JSON object of an failure +// jsonObject defines a JSON object of a failure type jsonObject struct { Severity lint.Severity lint.Failure `json:",inline"` @@ -182,6 +182,7 @@ func createConfigMap(cfg *config.ReviveSettings) map[string]interface{} { "severity": cfg.Severity, "errorCode": cfg.ErrorCode, "warningCode": cfg.WarningCode, + "enableAllRules": cfg.EnableAllRules, } rawDirectives := map[string]map[string]interface{}{}