-
Notifications
You must be signed in to change notification settings - Fork 695
Expand file tree
/
Copy path.golangci.yml
More file actions
115 lines (115 loc) · 2.61 KB
/
.golangci.yml
File metadata and controls
115 lines (115 loc) · 2.61 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
version: "2"
run:
modules-download-mode: readonly
issues-exit-code: 1
tests: true
allow-parallel-runners: false
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- copyloopvar
- durationcheck
- errchkjson
- errorlint
- exhaustive
- gocheckcompilerdirectives
- gochecksumtype
- gocritic
- gomodguard
- gosec
- gosmopolitan
- loggercheck
- makezero
- misspell
- musttag
- nilerr
- nilnesserr
- noctx
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- spancheck
- sqlclosecheck
- testifylint
- unconvert
- unparam
- whitespace
- zerologlint
# all available settings of specific linters
settings:
gomodguard:
blocked:
# List of blocked modules.
modules:
- io/ioutil:
recommendations:
- io
- os
reason: Deprecation of package ioutil in Go 1.16.
govet:
enable:
- shadow
settings:
shadow:
# Whether to be strict about shadowing; can be noisy.
strict: false
misspell:
locale: US
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# Exclude some linters from running on tests files.
- linters:
- dupl
- errcheck
- gocyclo
path: _test\.go
# Too many false positives - for examples see: https://github.com/Antonboom/testifylint/issues/67
- linters:
- testifylint
text: require must only be used in the goroutine running the test function
- linters:
- testifylint
text: contains assertions that must only be used in the goroutine running the test function
# It is valid usage to wrap errors without using %w to not make them part of
# the API contract.
- linters:
- errorlint
text: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
- path: (.+)\.go$
text: Using the variable on range scope `tc` in function literal
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofumpt
- goimports
settings:
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
goimports:
local-prefixes:
- sigs.k8s.io/gateway-api
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$