Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
go-version: '^1.23'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: latest
only-new-issues: true
Expand Down
193 changes: 111 additions & 82 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,90 +1,119 @@
# https://golangci-lint.run/usage/configuration/

version: "2"
run:
build-tags:
- envtest
linters:
disable:
- contextcheck
- gci
- gofumpt
- goimports
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- depguard
- durationcheck
- errchkjson
- errorlint
- exhaustive
- gocheckcompilerdirectives
- gochecksumtype
- gomodguard
- gosimple
- gosec
- gosmopolitan
- importas
- loggercheck
- makezero
- misspell
- musttag
- nilerr
- nilnesserr
- noctx
- protogetter
- reassign
- recvcheck
- rowserrcheck
- spancheck
- sqlclosecheck
- testifylint
- unconvert
presets:
- bugs
- format
- unused

linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/percona)

depguard:
- unparam
- zerologlint
disable:
- contextcheck
settings:
depguard:
rules:
everything:
deny:
- pkg: io/ioutil
desc: |
Use the "io" and "os" packages instead. See https://go.dev/doc/go1.16#ioutil
not-tests:
files:
- '!$test'
deny:
- pkg: net/http/httptest
desc: Should be used only in tests.
- pkg: testing/*
desc: The "testing" packages should be used only in tests.
- pkg: github.com/percona/percona-postgresql-operator/internal/testing/*
desc: The "internal/testing" packages should be used only in tests.
tests:
files:
- $test
deny:
- pkg: github.com/pkg/errors
desc: Use the "errors" package unless you are interacting with stack traces.
errchkjson:
check-error-free-encoding: true
exhaustive:
default-signifies-exhaustive: true
gomodguard:
blocked:
modules:
- gopkg.in/yaml.v2:
recommendations:
- sigs.k8s.io/yaml
- gopkg.in/yaml.v3:
recommendations:
- sigs.k8s.io/yaml
- gotest.tools:
recommendations:
- gotest.tools/v3
- k8s.io/kubernetes:
reason: |
k8s.io/kubernetes is for managing dependencies of the Kubernetes project, i.e. building kubelet and kubeadm.
importas:

Check failure on line 84 in .golangci.yaml

View workflow job for this annotation

GitHub Actions / misspell

[misspell] .golangci.yaml#L84

"importas" is a misspelling of "imports"
Raw output
./.golangci.yaml:84:4: "importas" is a misspelling of "imports"
alias:
- pkg: k8s.io/api/(\w+)/(v[\w\w]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
alias: $1$2
no-unaliased: true
exclusions:
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
everything:
deny:
- pkg: io/ioutil
desc: >
Use the "io" and "os" packages instead.
See https://go.dev/doc/go1.16#ioutil

not-tests:
files: ['!$test']
deny:
- pkg: net/http/httptest
desc: Should be used only in tests.

- pkg: testing/*
desc: The "testing" packages should be used only in tests.

- pkg: github.com/percona/percona-postgresql-operator/internal/testing/*
desc: The "internal/testing" packages should be used only in tests.

tests:
files: ['$test']
deny:
- pkg: github.com/pkg/errors
desc: Use the "errors" package unless you are interacting with stack traces.

errchkjson:
check-error-free-encoding: true

exhaustive:
default-signifies-exhaustive: true

gomodguard:
blocked:
modules:
- gopkg.in/yaml.v2: { recommendations: [sigs.k8s.io/yaml] }
- gopkg.in/yaml.v3: { recommendations: [sigs.k8s.io/yaml] }
- gotest.tools: { recommendations: [gotest.tools/v3] }
- k8s.io/kubernetes:
reason: >
k8s.io/kubernetes is for managing dependencies of the Kubernetes
project, i.e. building kubelet and kubeadm.

importas:
alias:
- pkg: k8s.io/api/(\w+)/(v[\w\w]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
alias: $1$2
no-unaliased: true

run:
build-tags:
- envtest
issues:
exclude-generated: strict
exclude-rules:
# These value types have unmarshal methods.
# https://github.com/raeperd/recvcheck/issues/7
- linters: [recvcheck]
path: internal/pki/pki.go
text: 'methods of "(Certificate|PrivateKey)"'
- linters:
- recvcheck
path: internal/pki/pki.go
text: methods of "(Certificate|PrivateKey)"
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/percona)
exclusions:
paths:
- third_party$
- builtin$
- examples$
Loading