version: "2"
run:
tests: true
linters:
enable:
- copyloopvar
- errname
- errorlint
- exhaustive
- exhaustruct
- exptostd
- gocritic
- godot
- importas
- iotamixing
- misspell
- modernize
- nakedret
- nilnesserr
- perfsprint
- prealloc
- predeclared
- promlinter
- revive
- testifylint
- unconvert
- usetesting
settings:
exhaustruct:
exclude:
- net/http\..+
- crypto/tls\..+
- encoding/xml\..+
- .+/checks\.badMatcher
- .+/checks\..+Settings
- .+/config\.Match
- .+/discovery\.Entry
- .+/parser\.Rule
- .+/parser\.ParseError
- .+/parser\.VectorSelector
- .+/promapi\.MetricTimeRange
- github.com/prometheus/.+\..+
- github.com/urfave/cli/.+
- gitlab.com/gitlab-org/api/.+
- github.com/google/go-github/.+
- github.com/hashicorp/hcl/.+
govet:
enable-all: true
exclusions:
generated: lax
presets:
- comments
- std-error-handling
rules:
- linters:
- exhaustruct
path: ^.*_test\.go$
- linters:
- revive
path: ^internal/parser/utils/
text: "var-naming: avoid meaningless package names"
- linters:
- revive
path: ^internal/log/
text: "var-naming: avoid package names that conflict with Go standard library package names"
- linters:
- revive
path: ^internal/parser/
text: "var-naming: avoid package names that conflict with Go standard library package names"
issues:
max-same-issues: 0
formatters:
enable:
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: true
goimports:
local-prefixes:
- github.com/cloudflare/pintcloudflare/pint
Publicmirrored fromhttps://github.com/cloudflare/pintAvailable
.golangci.yml
81lines · modepreview