aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgechev/revive/config
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-03-04 17:40:11 +0000
committerTaras Madan <tarasmadan@google.com>2024-03-04 18:34:55 +0000
commit5fc5366972c874b919f93165bb4ed4e2bcb7c350 (patch)
tree287c3361a0dee0c72af80d9a1a66714a06e98a62 /vendor/github.com/mgechev/revive/config
parent1be5ce38a9059c356eb193a8c34d60d61c9fc31f (diff)
mod: bump github.com/golangci/golangci-lint from 1.55.2 to 1.56.2
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.55.2 to 1.56.2. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v1.55.2...v1.56.2) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/mgechev/revive/config')
-rw-r--r--vendor/github.com/mgechev/revive/config/config.go22
1 files changed, 18 insertions, 4 deletions
diff --git a/vendor/github.com/mgechev/revive/config/config.go b/vendor/github.com/mgechev/revive/config/config.go
index abd554a9f..50a2b8966 100644
--- a/vendor/github.com/mgechev/revive/config/config.go
+++ b/vendor/github.com/mgechev/revive/config/config.go
@@ -1,3 +1,4 @@
+// Package config implements revive's configuration data structures and related methods
package config
import (
@@ -5,9 +6,9 @@ import (
"fmt"
"os"
- "github.com/mgechev/revive/formatter"
-
"github.com/BurntSushi/toml"
+
+ "github.com/mgechev/revive/formatter"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
@@ -54,7 +55,7 @@ var allRules = append([]lint.Rule{
&rule.ModifiesValRecRule{},
&rule.ConstantLogicalExprRule{},
&rule.BoolLiteralRule{},
- &rule.ImportsBlacklistRule{},
+ &rule.ImportsBlocklistRule{},
&rule.FunctionResultsLimitRule{},
&rule.MaxPublicStructsRule{},
&rule.RangeValInClosureRule{},
@@ -91,6 +92,9 @@ var allRules = append([]lint.Rule{
&rule.RedundantImportAlias{},
&rule.ImportAliasNamingRule{},
&rule.EnforceMapStyleRule{},
+ &rule.EnforceRepeatedArgTypeStyleRule{},
+ &rule.EnforceSliceStyleRule{},
+ &rule.MaxControlNestingRule{},
}, defaultRules...)
var allFormatters = []lint.Formatter{
@@ -128,7 +132,8 @@ func GetLintingRules(config *lint.Config, extraRules []lint.Rule) ([]lint.Rule,
var lintingRules []lint.Rule
for name, ruleConfig := range config.Rules {
- r, ok := rulesMap[name]
+ actualName := actualRuleName(name)
+ r, ok := rulesMap[actualName]
if !ok {
return nil, fmt.Errorf("cannot find rule: %s", name)
}
@@ -143,6 +148,15 @@ func GetLintingRules(config *lint.Config, extraRules []lint.Rule) ([]lint.Rule,
return lintingRules, nil
}
+func actualRuleName(name string) string {
+ switch name {
+ case "imports-blacklist":
+ return "imports-blocklist"
+ default:
+ return name
+ }
+}
+
func parseConfig(path string, config *lint.Config) error {
file, err := os.ReadFile(path)
if err != nil {