forked from telepresenceio/telepresence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
118 lines (108 loc) · 3.27 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
run:
build-tags:
- citest
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|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:
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/TinderBackend/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: false
allow-leading-space: false
require-explanation: true
require-specific: true
allow-no-explanation:
- gocognit
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exportloopref
- forbidigo
- gci
- gocognit
- gocritic
- gocyclo
- gofmt
- gomodguard
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- nolintlint
- prealloc
- staticcheck
- structcheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace
# don't enable:
# - dupl
# - funlen
# - gochecknoglobals
# - gochecknoinits
# - goconst
# - godox
# - goimports # use gci instead
# - golint
# - gosec
# - interfacer
# - maligned # is premature-optimization
# - stylecheck
# - unparam