forked from gardener/gardener-extension-provider-openstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yaml
More file actions
121 lines (121 loc) · 4.39 KB
/
.golangci.yaml
File metadata and controls
121 lines (121 loc) · 4.39 KB
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
version: "2"
run:
concurrency: 4
linters:
enable:
- ginkgolinter
- importas
- misspell
- nilerr
- revive
- unconvert
- unparam
- whitespace
settings:
importas:
alias:
# internal packages
- pkg: github.com/gardener/gardener-extension-provider-gcp/pkg/apis/openstack
alias: api
- pkg: github/com/gardener/gardener-extension-provider-openstack/pkg/apis/openstack/v1alpha1
alias: apiv1alpha1
# External imported packages
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/api/([^m]\w+)
alias: api${1}
- pkg: k8s.io/apimachinery/pkg/util/(\w+)
alias: util${1}
- pkg: k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1
alias: vpaautoscalingv1
- pkg: sigs.k8s.io/controller-runtime/pkg/client/fake
alias: fakeclient
- pkg: sigs.k8s.io/controller-runtime/pkg/log/zap
alias: logzap
- pkg: sigs.k8s.io/controller-runtime/pkg/log
alias: logf
- pkg: go.uber.org/mock/gomock
alias: gmock
# gardener/gardener packages
- pkg: github.com/gardener/gardener/pkg/component/(\w+)/constants
alias: ${1}constants
- pkg: github.com/gardener/gardener/extensions/pkg/webhook
alias: extensionswebhook
- pkg: github.com/gardener/gardener/extensions/pkg/util/secret/manager
alias: extensionssecretmanager
- pkg: github.com/gardener/gardener/pkg/utils/gardener
alias: gutil
- pkg: github.com/gardener/gardener/pkg/utils/kubernetes
alias: kutil
- pkg: github.com/gardener/etcd-druid/api/core/v1alpha1
alias: druidcorev1alpha1
- pkg: github.com/gardener/etcd-druid/api/core/crds
alias: druidcorecrds
loggercheck:
require-string-key: true
no-printf-like: true
misspell:
mode: restricted # only check comments
revive:
rules:
- name: duplicated-imports
- name: unused-parameter
- name: unreachable-code
- name: context-as-argument
- name: early-return
- name: exported
exclusions:
generated: lax
rules:
- linters:
- staticcheck
text: 'SA1019:' # Excludes messages where deprecated variables are used
- linters:
- staticcheck
text: 'ST1001:' # should not use dot imports
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- path: (.+)\.go$
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
# revive:
- path: (.+)\.go$
text: var-naming # ((var|const|struct field|func) .* should be .*
- path: (.+)\.go$
text: dot-imports # should not use dot imports
- path: (.+)\.go$
text: package-comments # package comment should be of the form
- path: (.+)\.go$
text: unexported-return # exported func .* returns unexported type .*, which can be annoying to use
- path: (.+)\.go$
text: indent-error-flow # if block ends with a return statement, so drop this else and outdent its block
- path: (.+)\.go$
text: 'exported: (type|func) name will be used as .* by other packages, and that stutters;'
- path: (.+)\.go$
text: exported function Convert_.* should have comment or be unexported
- path: (.+)\.go$
text: redundant-import-alias
# typecheck:
- path: (.+)\.go$
text: 'undeclared name: `.*`'
- path: (.+)\.go$
text: '".*" imported but not used'
# allow non-capitalized messages if they start with technical terms
- path: (.+)\.go$
text: 'structured logging message should be capitalized: "garden(er-apiserver|er-controller-manager|er-admission-controller|er-operator|er-resource-manager|let)'
paths:
- zz_generated\..*\.go$
- examples$
formatters: # how code formatting is handled
settings:
gofmt:
rewrite-rules:
- pattern: interface{}
replacement: any
exclusions:
generated: lax
paths:
- examples$
issues:
max-issues-per-linter: 0 # A value of 0 means no limit
max-same-issues: 0 # A value of 0 means no limit