-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.golangci.yml
166 lines (160 loc) · 6.12 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
linters-settings:
lll:
line-length: 190
funlen:
lines: 180
statements: 80 # must be 70. ISSUE-431. Need to refactor handleDriveUpdate
gocognit:
min-complexity: 60
golint:
# godoc says that one of files from a package should contain package comment.
# but golint has constraint that checks package comment in every file of the package.
# golint developers mention that this is imperfection. https://github.com/golang/lint/blob/master/lint.go#L376
# To prevent this checking set min-confidence level to 0.3
min-confidence: 0.3
depguard:
rules:
main:
files:
- $all
- "!$test"
allow:
- $gostd
- github.com/antonfisher/nested-logrus-formatter
- github.com/container-storage-interface/spec/lib/go/csi
- github.com/dell/csi-baremetal-operator/api/v1
- github.com/dell/csi-baremetal-operator/api/v1/components
- github.com/dell/csi-baremetal-operator/pkg
- github.com/dell/csi-baremetal-operator/pkg/feature/security_verifier
- github.com/dell/csi-baremetal-operator/pkg/feature/security_verifier/models
- github.com/dell/csi-baremetal-operator/pkg/validator
- github.com/dell/csi-baremetal-operator/pkg/validator/models
- github.com/dell/csi-baremetal-operator/pkg/validator/rbac
- github.com/dell/csi-baremetal-operator/pkg/common
- github.com/dell/csi-baremetal-operator/pkg/constant
- github.com/dell/csi-baremetal-operator/pkg/node
- github.com/dell/csi-baremetal-operator/pkg/nodeoperations
- github.com/dell/csi-baremetal-operator/pkg/patcher
- github.com/dell/csi-baremetal-operator/controllers
- github.com/dell/csi-baremetal-operator/pkg/acrvalidator
- github.com/dell/csi-baremetal/pkg/events/recorder
- github.com/dell/csi-baremetal/pkg/crcontrollers/node/common
- github.com/dell/csi-baremetal/pkg/eventing
- github.com/dell/csi-baremetal/pkg/events
- github.com/dell/csi-baremetal/api/v1/acreservationcrd
- github.com/dell/csi-baremetal/api/v1/availablecapacitycrd
- github.com/dell/csi-baremetal/api/v1/drivecrd
- github.com/dell/csi-baremetal/api/v1/lvgcrd
- github.com/dell/csi-baremetal/api/v1/nodecrd
- github.com/dell/csi-baremetal/api/v1/volumecrd
- github.com/fsnotify/fsnotify
- github.com/golang/protobuf/ptypes/wrappers
- github.com/google/uuid
- github.com/grpc-ecosystem/go-grpc-prometheus
- github.com/prometheus/client_golang/prometheus
- github.com/sirupsen/logrus
- github.com/stretchr/testify/assert
- github.com/stretchr/testify/mock
- github.com/viney-shih/go-lock
- github.com/openshift/api/config/v1
- github.com/openshift/api/operator/v1
- github.com/openshift/secondary-scheduler-operator/pkg/apis/secondaryscheduler/v1
- github.com/dell/csi-baremetal-operator/pkg/constant
- github.com/masterminds/semver
- k8s.io/api/apps/v1
- k8s.io/api/core/v1
- k8s.io/api/rbac/v1
- k8s.io/api/storage/v1
- k8s.io/apimachinery/pkg/api/errors
- k8s.io/apimachinery/pkg/api/meta
- k8s.io/apimachinery/pkg/api/resource
- k8s.io/apimachinery/pkg/apis/meta/v1
- k8s.io/apimachinery/pkg/runtime
- k8s.io/apimachinery/pkg/types
- k8s.io/apimachinery/pkg/labels
- k8s.io/apimachinery/pkg/util/intstr
- k8s.io/apimachinery/pkg/api/equality
- k8s.io/apimachinery/pkg/fields
- k8s.io/client-go/kubernetes
- k8s.io/client-go/plugin/pkg/client/auth/gcp
- k8s.io/client-go/rest
- k8s.io/client-go/tools/record
- k8s.io/client-go/tools/reference
- k8s.io/client-go/util/retry
- k8s.io/client-go/util/workqueue
- k8s.io/kube-scheduler/extender/v1
- k8s.io/utils/keymutex
- k8s.io/utils/ptr
- sigs.k8s.io/controller-runtime
- sigs.k8s.io/controller-runtime/pkg/cache
- sigs.k8s.io/controller-runtime/pkg/client
- sigs.k8s.io/controller-runtime/pkg/controller
- sigs.k8s.io/controller-runtime/pkg/event
- sigs.k8s.io/controller-runtime/pkg/handler
- sigs.k8s.io/controller-runtime/pkg/manager
- sigs.k8s.io/controller-runtime/pkg/predicate
- sigs.k8s.io/controller-runtime/pkg/source
- sigs.k8s.io/controller-runtime/pkg/reconcile
- sigs.k8s.io/controller-runtime/pkg/log/zap
- sigs.k8s.io/controller-runtime/pkg/metrics/server
- sigs.k8s.io/controller-runtime/pkg/webhook
test:
files:
- "$test"
allow:
- $gostd
linters:
# please, do not use `enable-all`: it is deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
- exportloopref
- funlen
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gosimple
- gosec
- govet
- ineffassign
- lll
- megacheck
- misspell
- nakedret
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- prealloc
# don't enable:
# - gochecknoglobals Because of setupMgr and CrushVolumes // TODO - https://github.com/dell/csi-baremetal/issues/474
# - godox CSI now has a lot TODOs in source code
# - wsl
# - stylecheck because it is similar to golint and there is conflict between them
run:
deadline: 15m
timeout: 15m
skip-dirs:
- test/
- vendor/
- api/
skip-files:
- .*_test.go
- .*.pb.go
# golint is disabled by default in golang-ci because of golang community
issues:
exclude-use-default: false