-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgolangci.yml
More file actions
154 lines (153 loc) · 3.66 KB
/
golangci.yml
File metadata and controls
154 lines (153 loc) · 3.66 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
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
# Config for golangci-lint - shared across fortio org projects (included by gochecks workflow step)
# Migrated to v2.
version: "2"
linters:
default: all
disable:
- exhaustruct # seems like a good idea at first but actually a pain and go does have zero values for a reason.
- gochecknoglobals
- gochecknoinits
# can't get it to accept //nolint so... have to disable it
- gomoddirectives
- mnd
- musttag
- nlreturn
- nonamedreturns
- tagliatelle
- testpackage
- varnamelen
- wrapcheck
# consider putting these back, when they stop being bugged (ifshort, wastedassign,...)
- paralleltest
- thelper
- forbidigo
- wastedassign
- cyclop
- forcetypeassert
- ireturn
- depguard
# newer bad ones:
- wsl
- wsl_v5
- funcorder
- noinlineerr # prize for worst linter ever
- embeddedstructfieldcheck
- gosmopolitan
settings:
staticcheck:
# dot-import-whitelist: [] # Note: not yet working
dot-import-whitelist:
- github.com/does/not/exist # until we can put [] in the config
# http-status-code-whitelist: [] # Note: not yet working
http-status-code-whitelist:
- "418" # until we can put [] in the config/allow teapot!
checks:
- all
- -QF1008
dupl:
threshold: 100
exhaustive:
default-signifies-exhaustive: true
funlen:
lines: 140
statements: 70
gocognit:
min-complexity: 42
gocyclo:
min-complexity: 30
govet:
enable-all: true
disable-all: false
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Printf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).FErrf
lll:
line-length: 132
tab-width: 1
misspell:
locale: US
ignore-rules:
- fortio
nakedret:
max-func-lines: 30
nestif:
min-complexity: 4
nolintlint:
require-specific: true
require-explanation: true
whitespace:
multi-if: false
multi-func: false
revive:
enable-default-rules: true
rules:
- name: var-naming
arguments:
- []
- []
- - skip-package-name-collision-with-go-std: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- dupl
- err113
- errcheck
- forcetypeassert
- gochecknoglobals
- gochecknoinits
- goconst
- gocyclo
- gosec
- noctx
- nosnakecase
path: _test\.go
- linters:
- lll
source: '^//go:generate '
- linters:
- err113
text: do not define dynamic errors
- linters:
- govet
text: 'fieldalignment:'
- linters:
- godox
text: TODO
- linters:
- nosnakecase
text: grpc_|_SERVING|O_
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
severity:
default: error
formatters:
enable:
- gci
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: false
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$