2022-08-18 01:16:43 +02:00
|
|
|
[run]
|
2024-07-14 14:40:59 +02:00
|
|
|
# This is needed for precious, which may run multiple instances
|
|
|
|
# in parallel
|
|
|
|
allow-parallel-runners = true
|
|
|
|
go = "1.21"
|
|
|
|
tests = true
|
|
|
|
timeout = "10m"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters]
|
2024-07-14 14:40:59 +02:00
|
|
|
enable-all = true
|
|
|
|
disable = [
|
|
|
|
"cyclop",
|
2022-08-18 01:16:43 +02:00
|
|
|
"depguard",
|
2024-07-14 14:40:59 +02:00
|
|
|
"err113",
|
|
|
|
"execinquery",
|
|
|
|
"exhaustive",
|
|
|
|
"exhaustruct",
|
|
|
|
"forcetypeassert",
|
|
|
|
"funlen",
|
|
|
|
"gochecknoglobals",
|
|
|
|
"godox",
|
|
|
|
"gomnd",
|
|
|
|
"inamedparam",
|
|
|
|
"interfacebloat",
|
|
|
|
"mnd",
|
|
|
|
"nlreturn",
|
|
|
|
"nonamedreturns",
|
|
|
|
"paralleltest",
|
|
|
|
"thelper",
|
|
|
|
"testpackage",
|
|
|
|
|
|
|
|
"varnamelen",
|
|
|
|
"wrapcheck",
|
|
|
|
"wsl",
|
|
|
|
|
|
|
|
# Require Go 1.22
|
|
|
|
"copyloopvar",
|
|
|
|
"intrange",
|
|
|
|
]
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters-settings.errorlint]
|
2024-07-14 14:40:59 +02:00
|
|
|
errorf = true
|
|
|
|
asserts = true
|
|
|
|
comparison = true
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters-settings.exhaustive]
|
2024-07-14 14:40:59 +02:00
|
|
|
default-signifies-exhaustive = true
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters-settings.forbidigo]
|
2024-07-14 14:40:59 +02:00
|
|
|
# Forbid the following identifiers
|
|
|
|
forbid = [
|
|
|
|
{ p = "Geoip", msg = "you should use `GeoIP`" },
|
|
|
|
{ p = "geoIP", msg = "you should use `geoip`" },
|
|
|
|
{ p = "Maxmind", msg = "you should use `MaxMind`" },
|
|
|
|
{ p = "^maxMind", msg = "you should use `maxmind`" },
|
|
|
|
{ p = "Minfraud", msg = "you should use `MinFraud`" },
|
|
|
|
{ p = "^minFraud", msg = "you should use `minfraud`" },
|
|
|
|
{ p = "^math.Max$", msg = "you should use the max built-in instead." },
|
|
|
|
{ p = "^math.Min$", msg = "you should use the min built-in instead." },
|
|
|
|
{ p = "^os.IsNotExist", msg = "As per their docs, new code should use errors.Is(err, fs.ErrNotExist)." },
|
|
|
|
{ p = "^os.IsExist", msg = "As per their docs, new code should use errors.Is(err, fs.ErrExist)" },
|
|
|
|
]
|
|
|
|
|
|
|
|
[linters-settings.gci]
|
|
|
|
sections = ["standard", "default", "prefix(github.com/oschwald/maxminddb-golang)"]
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters-settings.gofumpt]
|
2024-07-14 14:40:59 +02:00
|
|
|
extra-rules = true
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters-settings.govet]
|
2024-07-14 14:40:59 +02:00
|
|
|
enable-all = true
|
|
|
|
disable = "shadow"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters-settings.lll]
|
2024-07-14 14:40:59 +02:00
|
|
|
line-length = 120
|
|
|
|
tab-width = 4
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[linters-settings.misspell]
|
|
|
|
locale = "US"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[[linters-settings.misspell.extra-words]]
|
|
|
|
typo = "marshall"
|
|
|
|
correction = "marshal"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[[linters-settings.misspell.extra-words]]
|
|
|
|
typo = "marshalling"
|
|
|
|
correction = "marshaling"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[[linters-settings.misspell.extra-words]]
|
|
|
|
typo = "marshalls"
|
|
|
|
correction = "marshals"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[[linters-settings.misspell.extra-words]]
|
|
|
|
typo = "unmarshall"
|
|
|
|
correction = "unmarshal"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[[linters-settings.misspell.extra-words]]
|
|
|
|
typo = "unmarshalling"
|
|
|
|
correction = "unmarshaling"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[[linters-settings.misspell.extra-words]]
|
|
|
|
typo = "unmarshalls"
|
|
|
|
correction = "unmarshals"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[linters-settings.nolintlint]
|
|
|
|
allow-unused = false
|
|
|
|
allow-no-explanation = ["lll", "misspell"]
|
|
|
|
require-explanation = true
|
|
|
|
require-specific = true
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2024-07-14 14:40:59 +02:00
|
|
|
[linters-settings.revive]
|
|
|
|
enable-all-rules = true
|
|
|
|
ignore-generated-header = true
|
|
|
|
severity = "warning"
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "add-constant"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "cognitive-complexity"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "confusing-naming"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "confusing-results"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "cyclomatic"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "deep-exit"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "flag-parameter"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "function-length"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "function-result-limit"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "line-length-limit"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "max-public-structs"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "nested-structs"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "unchecked-type-assertion"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[[linters-settings.revive.rules]]
|
|
|
|
name = "unhandled-error"
|
|
|
|
disabled = true
|
|
|
|
|
|
|
|
[linters-settings.tagliatelle.case.rules]
|
|
|
|
avro = "snake"
|
|
|
|
bson = "snake"
|
|
|
|
env = "upperSnake"
|
|
|
|
envconfig = "upperSnake"
|
|
|
|
json = "snake"
|
|
|
|
mapstructure = "snake"
|
|
|
|
xml = "snake"
|
|
|
|
yaml = "snake"
|
2022-08-18 01:16:43 +02:00
|
|
|
|
|
|
|
[linters-settings.unparam]
|
2024-07-14 14:40:59 +02:00
|
|
|
check-exported = true
|
2022-08-18 01:16:43 +02:00
|
|
|
|
2023-07-13 22:34:10 +02:00
|
|
|
|
2022-08-18 01:16:43 +02:00
|
|
|
[[issues.exclude-rules]]
|
2024-07-14 14:40:59 +02:00
|
|
|
linters = [
|
|
|
|
"govet",
|
|
|
|
"revive",
|
|
|
|
]
|
|
|
|
path = "_test.go"
|
|
|
|
text = "fieldalignment:"
|