aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgechev/revive/lint
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/lint
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/lint')
-rw-r--r--vendor/github.com/mgechev/revive/lint/config.go5
-rw-r--r--vendor/github.com/mgechev/revive/lint/doc.go2
-rw-r--r--vendor/github.com/mgechev/revive/lint/utils.go11
3 files changed, 13 insertions, 5 deletions
diff --git a/vendor/github.com/mgechev/revive/lint/config.go b/vendor/github.com/mgechev/revive/lint/config.go
index 9b26d5841..7e51a93c2 100644
--- a/vendor/github.com/mgechev/revive/lint/config.go
+++ b/vendor/github.com/mgechev/revive/lint/config.go
@@ -3,6 +3,7 @@ package lint
// Arguments is type used for the arguments of a rule.
type Arguments = []interface{}
+// FileFilters is type used for modeling file filters to apply to rules.
type FileFilters = []*FileFilter
// RuleConfig is type used for the rule configuration.
@@ -32,8 +33,8 @@ func (rc *RuleConfig) Initialize() error {
type RulesConfig = map[string]RuleConfig
// MustExclude - checks if given filename `name` must be excluded
-func (rcfg *RuleConfig) MustExclude(name string) bool {
- for _, exclude := range rcfg.excludeFilters {
+func (rc *RuleConfig) MustExclude(name string) bool {
+ for _, exclude := range rc.excludeFilters {
if exclude.MatchFileName(name) {
return true
}
diff --git a/vendor/github.com/mgechev/revive/lint/doc.go b/vendor/github.com/mgechev/revive/lint/doc.go
new file mode 100644
index 000000000..7048adf4b
--- /dev/null
+++ b/vendor/github.com/mgechev/revive/lint/doc.go
@@ -0,0 +1,2 @@
+// Package lint implements the linting machinery.
+package lint
diff --git a/vendor/github.com/mgechev/revive/lint/utils.go b/vendor/github.com/mgechev/revive/lint/utils.go
index 28657c6df..6ccfb0ef2 100644
--- a/vendor/github.com/mgechev/revive/lint/utils.go
+++ b/vendor/github.com/mgechev/revive/lint/utils.go
@@ -6,7 +6,7 @@ import (
)
// Name returns a different name if it should be different.
-func Name(name string, whitelist, blacklist []string) (should string) {
+func Name(name string, allowlist, blocklist []string) (should string) {
// Fast path for simple cases: "_" and all lowercase.
if name == "_" {
return name
@@ -57,12 +57,12 @@ func Name(name string, whitelist, blacklist []string) (should string) {
// [w,i) is a word.
word := string(runes[w:i])
ignoreInitWarnings := map[string]bool{}
- for _, i := range whitelist {
+ for _, i := range allowlist {
ignoreInitWarnings[i] = true
}
extraInits := map[string]bool{}
- for _, i := range blacklist {
+ for _, i := range blocklist {
extraInits[i] = true
}
@@ -71,6 +71,10 @@ func Name(name string, whitelist, blacklist []string) (should string) {
if w == 0 && unicode.IsLower(runes[w]) {
u = strings.ToLower(u)
}
+ // Keep lowercase s for IDs
+ if u == "IDS" {
+ u = "IDs"
+ }
// All the common initialisms are ASCII,
// so we can replace the bytes exactly.
copy(runes[w:], []rune(u))
@@ -99,6 +103,7 @@ var commonInitialisms = map[string]bool{
"HTTP": true,
"HTTPS": true,
"ID": true,
+ "IDS": true,
"IP": true,
"JSON": true,
"LHS": true,