-
Notifications
You must be signed in to change notification settings - Fork 14
/
.golangci.yml
144 lines (140 loc) · 3.33 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
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
gocyclo:
min-complexity: 16
cyclop:
max-complexity: 16
dupl:
threshold: 128
funlen:
lines: 128
statements: 64
goconst:
min-len: 4
min-occurrences: 3
depguard:
list-type: blacklist
packages:
- github.com/sirupsen/logrus
- sigs.k8s.io/controller-runtime/pkg/log
- sigs.k8s.io/controller-runtime/pkg/log/zap
- sigs.k8s.io/controller-runtime/pkg/runtime/log
misspell:
locale: US
ignore-words:
- istio
- k8s
lll:
line-length: 180
goimports:
local-prefixes: github.com/maistra/istio-workspace
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc
- commentFormatting # https://github.com/go-critic/go-critic/issues/755
- hugeParam # seems to be premature optimization based on https://github.com/Maistra/istio-workspace/pull/378#discussion_r392208906
nestif:
min-complexity: 10
unused:
check-exported: true
gocognit:
min-complexity: 16
wrapcheck:
ignoreSigs:
- .Errorf(
- errors.New(
- errors.Unwrap(
- .Wrap(
- .Wrapf(
- .WithMessage(
- errors.WrapIfWithDetails
- errors.WithDetails(
- errors.WrapWithDetails(
- errors.WrapIf(
- errors.NewWithDetails(
linters:
enable-all: true
disable:
- contextcheck # FIXME https://github.com/maistra/istio-workspace/issues/1101
- exhaustivestruct
- exhaustruct
- forbidigo
- gochecknoinits # k8s/istio generated APIs are using init()
- gochecknoglobals
- gocognit # FIXME https://github.com/Maistra/istio-workspace/issues/478
- gofmt # We use goimports and when using them both leads to contradicting errors
- goimports # We use it explicitly as a build step
- gofumpt
- gomnd
- ireturn
- nonamedreturns
- nosnakecase # deprecated and complains about built-in consts, eg. os.O_RDWR ¯\_(ツ)_/¯
- paralleltest
- wsl # FIXME https://github.com/Maistra/istio-workspace/issues/481
- varnamelen # complains about e.g. loops
run:
deadline: 10m
skip-dirs:
- ./pkg/apis
- ./pkg/assets/generated
- ./pkg/client/clientset
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
- path: e2e/
linters:
- revive
- path: test/
linters:
- revive
- path: pkg/log
linters:
- depguard
- path: pkg/openshift/
linters:
- dupl
- path: pkg/k8s/
linters:
- dupl
- path: pkg/apis/
linters:
- stylecheck
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- dupword
- forcetypeassert
- gocyclo
- errcheck
- dupl
- gosec
- revive
- wrapcheck
- path: _suite_test\.go
linters:
- revive
- unused
- path: pkg/cmd/completion/shell_completion.go
linters:
- dupword
- path: pkg/assets/isto-workspace-deploy.go
linters:
- wrapcheck
- path: cmd/test-service/main.pb.go
linters:
- wrapcheck
- path: pkg/client/clientset
linters:
- wrapcheck