forked from telepresenceio/telepresence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
168 lines (160 loc) · 4.19 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
167
168
run:
build-tags:
- citest
modules-download-mode: readonly
issues:
# Give me the full output
max-same-issues: 0
# Use the default excludes...
exclude-use-default: false
# ...but also add some of our own
exclude:
- Error return value of `(\w+\.)+(Close|CloseSend|Flush|Remove|(Un)?Setenv|(Fp|P)rint(f|ln))\` is not checked
- 'structtag: struct field \w+ repeats json tag'
- 'Subprocess launched with function call as argument or cmd arguments'
exclude-rules:
- path: _test\.go
linters:
- const
- dupl
- gochecknoglobals
- goconst
- golint
- lll
- unparam
linters-settings:
cyclop:
max-complexity: 32
skip-tests: true
depguard:
list-type: blacklist
include-go-root: true
packages-with-error-message:
- io/ioutil: "`io/ioutil` is deprecated in Go 1.16, use `io` or `os` instead"
- os/exec: "Use `github.com/datawire/dlib/dexec` instead of `os/exec`"
- syscall: "Use `golang.org/x/sys/...` instead of `syscall`"
- github.com/golang/protobuf: "Use `google.golang.org/protobuf` instead of `github.com/golang/protobuf`"
- github.com/kballard/go-shellquote: "Use `github.com/telepresenceio/telepresence/pkg/shellquote.ShellString` instead of `github.com/kballard/go-shellquote.Join`"
- github.com/datawire/dlib/dutil: "Use either `github.com/datawire/dlib/derror` or `github.com/datawire/dlib/dhttp` instead of `github.com/datawire/dlib/dutil`"
- golang.org/x/net/http2/h2c: "Use `github.com/datawire/dlib/dhttp` instead of `golang.org/x/net/http2/h2c`"
gomodguard:
blocked:
modules:
- gotest.tools: { recommendations: ['github.com/stretchr/testify', 'github.com/google/go-cmp/cmp'] }
- gotest.tools/v2: { recommendations: ['github.com/stretchr/testify', 'github.com/google/go-cmp/cmp'] }
- gotest.tools/v3: { recommendations: ['github.com/stretchr/testify', 'github.com/google/go-cmp/cmp'] }
forbidigo:
forbid:
- '^os\.(DirEntry|FileInfo|FileMode|PathError)$' # deprecated in Go 1.16, import them from 'io/fs' instead
- '\.Readdir$' # deprecated in Go 1.16, use ReadDir instead
exclude_godoc_examples: false
gocyclo:
min-complexity: 35
gocognit:
min-complexity: 60
goimports:
# A comma-separated list
local-prefixes: github.com/telepresenceio,github.com/datawire
lll:
line-length: 180
tab-width: 2
nolintlint:
allow-unused: true # Needed because there's some linters disabled for 1.18
allow-leading-space: false
require-explanation: true
require-specific: true
allow-no-explanation:
- gocognit
linters:
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- cyclop
- decorder
- depguard
- dogsled
- durationcheck
- errcheck
- errname
- execinquery
- exportloopref
- forbidigo
- gocognit
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosimple
- govet
- grouper
- importas
- ineffassign
- lll
- logrlint
- makezero
- misspell
- nakedret
- nolintlint
- nosprintfhostport
- prealloc
- predeclared
- reassign
- staticcheck
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace
disable:
- containedctx
- contextcheck
- dupl
- errchkjson
- errorlint
- exhaustive
- exhaustruct
- forcetypeassert
- funlen
- gci
- gochecknoglobals
- gochecknoinits
- goconst
- goerr113
- godox
- gomnd
- gomoddirectives
- gosec
- interfacebloat
- ireturn
- maintidx
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nonamedreturns
- paralleltest
- promlinter
- revive
- rowserrcheck
- sqlclosecheck
- stylecheck
- tagliatelle
- tenv
- testpackage
- thelper
- tparallel
- typecheck
- varnamelen
- wastedassign
- wrapcheck
- wsl