1
0
mirror of https://github.com/mgechev/revive.git synced 2025-12-01 22:30:16 +02:00

refactor: rename blacklist to blocklist and whitelist to allowlist (#946)

* refactor: rename blacklist to blocklist and whitelist to allowlist
This commit is contained in:
Marcin Federowicz
2024-01-15 12:16:00 +01:00
committed by GitHub
parent af4f9ea960
commit 9abe06adfa
9 changed files with 159 additions and 24 deletions

View File

@@ -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
}