-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.golangci.yml
191 lines (189 loc) · 4.19 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
issues:
exclude-dirs:
- pkg/msqp
- pkg/mm
exclude-files:
- internal/web/data.go
linters:
# Disable all linters.
# Default: false
disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- copyloopvar
#- contextcheck
#- cyclop
- decorder
#- depguard
- dogsled
#- dupl
- dupword
#- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
#- exhaustive
#- exhaustruct
#- exportloopref
- forbidigo
- forcetypeassert
#- funlen
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
#- gocognit
- goconst
- gocritic
#- gocyclo
- gochecksumtype
- goconst
- gocritic
- godot
#- godox
- err113
- gofmt
- gofumpt
- goheader
- goimports
#- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- gosimple
- govet
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- intrange
#- ireturn
#- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
#- nestif
- nilerr
- nilnil
- nlreturn
- noctx
#- nolintlint
- nonamedreturns
- nosprintfhostport
#- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- sqlclosecheck
- sloglint
- spancheck
#- staticcheck
- stylecheck
#- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
#- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- varnamelen
- wastedassign
- whitespace
- wrapcheck
#- wsl
linters-settings:
wrapcheck:
# An array of strings that specify substrings of signatures to ignore.
# If this set, it will override the default set of ignored signatures.
# See https://github.com/tomarrell/wrapcheck#configuration for more information.
# Default: [".Errorf(", "errors.New(", "errors.Unwrap(", "errors.Join(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("]
ignoreSigs:
- .Errorf(
- errors.New(
- errors.Unwrap(
- errors.Join(
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
- river.JobCancel(
# An array of strings that specify regular expressions of signatures to ignore.
# Default: []
#ignoreSigRegexps:
# - \.New.*Error\(
# An array of strings that specify globs of packages to ignore.
# Default: []
ignorePackageGlobs:
# - encoding/*
- github.com/leighmacdonald/gbans/pkg/*
- github.com/leighmacdonald/gbans/internal/*
# An array of strings that specify regular expressions of interfaces to ignore.
# Default: []
#ignoreInterfaceRegexps:
# - ^(?i)c(?-i)ach(ing|e)
interfacebloat:
max: 26
tagliatelle:
case:
use-field-name: true
rules:
json: snake
yaml: snake
depguard:
# Rules to apply.
#
# Variables:
# - File Variables
# you can still use and exclamation mark ! in front of a variable to say not to use it.
# Example !$test will match any file that is not a go test file.
#
# `$all` - matches all go files
# `$test` - matches all go test files
#
# - Package Variables
#
# `$gostd` - matches all of go's standard library (Pulled from `GOROOT`)
#
# Default: Only allow $gostd in all files.
rules:
errors:
deny:
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package
- pkg: "go.uber.org/zap"
desc: Replaced with log/slog
funlen:
# Checks the number of lines in a function.
# If lower than 0, disable the check.
# Default: 60
lines: 100
# Checks the number of statements in a function.
# If lower than 0, disable the check.
# Default: 40
statements: -1