-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
147 lines (130 loc) · 3.29 KB
/
Copy path.golangci.yml
File metadata and controls
147 lines (130 loc) · 3.29 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
version: "2"
run:
timeout: 10m
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
- golines
settings:
gofmt:
rewrite-rules:
- pattern: "interface{}"
replacement: "any"
golines:
max-len: 100
tab-len: 8
gci:
sections:
- blank
- standard
- default
- localmodule
- dot
linters:
default: all
disable:
- cyclop # cyclomatic complexity, biased bs
- err113 # wants errors to be defined as var upfront, annoying
- funlen # detects long functions, annoying
- gocognit # calculates cognitive complexity, biased bs
- gocyclo # another cyclomatic complexity, biased bs
- godox # bans TODOs. BS
- inamedparam # we don't use named parameters in interfaces
- ireturn # bans returning interface types, buggy and biased bs
- lll # detects long lines, annoying
- maintidx # detects maintainability index, annoying biased bs
- mnd # detects magic numbers, annoying
- nestif # detects nested if statements, stupid
- nlreturn # blank lines after return statements, annoying
- testpackage # requires to create tests in separate packages like package_test
- wsl # replaced by wsl_v5
- noinlineerr # detects inline errors, annoying
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- path: _test\.go
linters:
- exhaustruct
settings:
depguard:
rules:
main:
deny:
- pkg: "math/rand$"
desc: use "math/rand/v2"
- pkg: "github.com/jackc/pgx/v4"
desc: use "github.com/jackc/pgx/v5"
- pkg: "github.com/pkg/errors"
desc: use stdlib
- pkg: "database/sql"
desc: use "github.com/jackc/pgx/v5"
exhaustive:
default-signifies-exhaustive: true
sloglint:
context: all
# report only misuses of `t.Parallel()`
paralleltest:
ignore-missing: true
ignore-missing-subtests: true
tagliatelle:
case:
rules:
json: camel
testifylint:
enable-all: true
govet:
enable-all: true
disable:
- shadow
exhaustruct:
exclude:
- github.com/jackc/pgx/v5/pgtype.Numeric
varnamelen:
ignore-names:
- a # comparison argument
- b # comparison argument, bytes, buffer
- ch # channel
- d # debug
- db # database
- e # event
- ev # event
- f # file
- fn # function
- fs # file system
- h # handler, hash
- hi # high
- i # idx
- id # id
- ip # ip address
- j # idx
- js # javascript
- k # idx
- l # len
- lo # low
- m # map, message
- mu # mutex
- n # number, no
- ns # namespace
- ok # ok
- r # reader, request
- rr # reader, response recorder
- s # string
- sb # string builder
- t # test, time
- tc # test case
- to # to
- ts # timestamp
- tt # test
- tx # transaction
- v # value
- w # writer, response
- wa # webauthn
- wg # waitgroup