-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yaml
156 lines (156 loc) · 5.37 KB
/
.golangci.yaml
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
linters:
disable-all: true
# One can't use disable and disable-all. disable-all is preferred to avoid lint failing when golangci gets updated and linters are added.
# at the same time but it is nice to explicitly state which linters we do not want.
#disable:
#- containedctx # Context.Context within a struct (as opposed to a func parameter) is nasty for many reasons, but actually sometimes useful.
#- contextcheck # Not that useful/false positives.
#- cyclop # Cyclo complexity already calculated by other linters.
#- depguard # We do not restrict imports.
#- dogsled # Could be nice in the future.
#- dupl # Could be nice in the future.
#- exhaustive # Not that useful/false positives.
#- exhaustruct # Not that useful/false positives.
#- forcetypeassert # We want a panic in situations when a type is asserted.
#- funlen # We really like long functions.
#- gci # Conflicts with other linters.
#- gochecknoglobals # We need globals.
#- gochecknoinits # We have a lot of those.
#- gocognit # Not that useful/false positives.
#- godox # Not that useful/false positives.
#- gomoddirectives # Not that useful/false positives.
#- inamedparam # Not that useful.
#- interfacebloat # WE do bloaty interfaces.
#- ireturn # Not that useful/false positives.
#- mnd # The annoy is strong.
#- nakedret # Naked return good return.
#- nlreturn # Could be nice in the future.
#- nonamedreturns # Named return good return.
#- tagliatelle # Reports issues that are not right for us.
#- testpackage # Could be nice in the future.
#- unparam # Not that useful/false positives.
#- varnamelen # Not that useful/false positives.
#- wrapcheck # Not that useful/false positives.
#- wsl # Not that useful/false positives.
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- copyloopvar
- decorder
- durationcheck
- err113
- errcheck
- errchkjson
- errname
- errorlint
- fatcontext
- forbidigo
- ginkgolinter
- gocheckcompilerdirectives
- gochecksumtype
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- intrange
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tenv
- testableexamples
- testifylint
- thelper
- tparallel
- typecheck
- unconvert
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
issues:
max-same-issues: 0
max-issues-per-linter: 0
exclude-dirs: []
exclude-rules:
# Integration tests MUST NOT run in parallel.
- path: 'test\/.+\.go'
linters: [paralleltest]
# Do not require comments on private packages and
# do not check their style.
- path: 'internal/'
text: '((comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)..."|should have a package comment)'
- path: 'cmd/'
text: '((comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)..."|should have a package comment)'
- path: 'integration/'
text: '((comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)..."|should have a package comment)'
include:
- EXC0001 # Check errors returned by io.Closer.
- EXC0002 # Require docs on exported pkg.
- EXC0003 # Just don't name a test pkg `test`.
- EXC0004 # Unsafe pkg is scary.
- EXC0005 # No ineffectual breaks.
- EXC0006 # Unsafe pkg is scary.
#- EXC0007 # Launching a subprocess using variables is not that odd.
#- EXC0008 # Duplicated check.
#- EXC0009 # World readable files are actually not a CVE
#- EXC0010 # Reading a file with a non literal path is not a CVE either.
- EXC0011 # Docs.
- EXC0012 # Docs.
- EXC0013 # Docs.
- EXC0014 # Docs.
- EXC0015 # Docs.
run:
build-tags:
- integration
linters-settings:
goimports:
local-prefixes: pkg.package-operator.run/boxcutter
gosec:
excludes:
- G301 # Poor file permissions used when creating a directory.
- G302 # Poor file permissions used with chmod.
- G306 # Poor file permissions used when writing to a new file.
- G601 # Taking address of loop variable - not relevant anymore.
- G602 # Should reports out of bound access but is broken.