Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
116 changes: 75 additions & 41 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,81 @@
run:
timeout: 8m

version: "2"
linters:
enable:
- gofmt
- goimports
- importas
- misspell
- stylecheck
- tparallel
- unconvert
- whitespace
- importas
- misspell
- staticcheck
- tparallel
- unconvert
- whitespace
disable:
- errcheck

linters-settings:
importas:
alias:
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/api/apps/v1
alias: appsv1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: github.com/operator-framework/api/pkg/operators/v1alpha1
alias: operatorsv1alpha1
- pkg: github.com/operator-framework/api/pkg/operators/v1
alias: operatorsv1
- pkg: github.com/operator-framework/api/pkg/operators/v2
alias: operatorsv2

- errcheck
settings:
importas:
alias:
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/api/apps/v1
alias: appsv1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: github.com/operator-framework/api/pkg/operators/v1alpha1
alias: operatorsv1alpha1
- pkg: github.com/operator-framework/api/pkg/operators/v1
alias: operatorsv1
- pkg: github.com/operator-framework/api/pkg/operators/v2
alias: operatorsv2
staticcheck:
# staticcheck absorbed stylecheck in v2 and additionally runs the
# stylistic QF (quickfix) checks, which the v1 configuration never
# enforced. Keep those off so the migration does not turn a tool bump
# into a repo-wide refactor.
checks:
- all
- -QF1001
- -QF1004
- -QF1006
- -QF1008
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- pkg/lib
- pkg/api
- pkg/fakes
- pkg/package-server/apis
- test/e2e
- third_party$
- builtin$
- examples$
rules:
# staticcheck in golangci-lint v2 reports deprecations the v1 pin did not
# know about. Migrating them is a behaviour change (RequeueAfter is not a
# drop-in for Requeue, and the List/Watch callbacks need context plumbing),
# so they are tracked separately rather than fixed in a tool bump.
- linters:
- staticcheck
text: 'SA1019: .*\.(Requeue|ListFunc|WatchFunc|SelfLink) is deprecated'
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-dirs:
- pkg/lib
- pkg/api
- pkg/fakes
- pkg/package-server/apis
- test/e2e

output:
formats: tab
sort-results: true
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- pkg/lib
- pkg/api
- pkg/fakes
- pkg/package-server/apis
- test/e2e
- third_party$
- builtin$
- examples$
Loading