-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy path.golangci.yml
More file actions
109 lines (107 loc) · 2.28 KB
/
.golangci.yml
File metadata and controls
109 lines (107 loc) · 2.28 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
version: "2"
run:
timeout: 10m
issues-exit-code: 1
tests: true
modules-download-mode: readonly
allow-parallel-runners: false
linters:
default: standard
enable:
- revive
- govet
- misspell
# bugs presets
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- durationcheck
- errcheck
- errchkjson
- errorlint
- exhaustive
- gocheckcompilerdirectives
- gochecksumtype
- gosec
- gosmopolitan
- loggercheck
- makezero
- musttag
- nilerr
- nilnesserr
- noctx
- protogetter
- reassign
- recvcheck
- rowserrcheck
- spancheck
- sqlclosecheck
- staticcheck
- testifylint
- zerologlint
# unused presets
- ineffassign
- unparam
- unused
settings:
revive:
rules:
- name: exported
disabled: true
govet:
# report about shadowed variables
enable:
- shadow
misspell:
locale: US
# (rkatz) - Added as we have a couple of APIs conversion (eg Istio, Kong) that convert uint->int and there's no solution
gosec:
excludes:
- G115
exclusions:
paths:
- third_party$
- builtin$
- examples$
rules:
# Exclude some linters from running on tests files.
- path: '_test\.go'
linters:
- gocyclo
- errcheck
- dupl
# Exclude gosec G104 (unhandled errors) from test files
- path: '_test\.go'
linters:
- gosec
text: "G104"
# Allow underscores in emitter package names
- path: pkg/i2gw/emitters/
linters:
- revive
text: "var-naming: don't use an underscore in package name"
- path: '(.+)\.go$'
text: "Using the variable on range scope `tc` in function literal"
# Allow capitalized error messages
- linters:
- staticcheck
text: "ST1005:"
# Allow embedded field, currently this style is used in many places
- linters:
- staticcheck
text: "QF1008:"
formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
exclusions:
paths:
- third_party$
- builtin$
- examples$