-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
106 lines (105 loc) · 2.88 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
linters-settings:
errcheck:
exclude-functions:
- (github.com/jackc/pgx/v5.Tx).Rollback
staticcheck:
checks: ["all"]
stylecheck:
checks: ["all"]
funlen:
lines: 200
cyclop:
max-complexity: 30
varnamelen:
max-distance: 15
ignore-names:
- id # generael identifier
- err # error values
- db # database connections
- tx # database transactions
- w # io.Writers
- r # io.Readers or http.Request
- ok # common bool
- rw # read-write database
- ro # read-only database
- ds # field path
- g # code generator group
linters:
enable-all: true
disable:
- dupl # false positive galore
- exhaustruct # CDK has large structs we use partially
- gochecknoinits # frameworks and magefile use init responsibly
- gci # no way to automate this in the vscode so default ordering is good enough
- ireturn # our oapi implementations return interfaces all the time
- depguard # too agressive
- tagliatelle # we have lots of aws tags that don't follow the standards
- nonamedreturns # makes some functions very unreadable
- wsl # too strict
- gochecknoglobals # too strict
- gomoddirectives # can't get this to shutup
- goconst # text identifiers makes it more readable
- funlen # trust our own judgement
- err113 # too much effort
- perfsprint #microoptimization
- gomnd
- canonicalheader
- execinquery
- unparam # don't be too smart
- dupword # gets in the way often when we're commenting out stuff
- containedctx # actually common for actors/workers that have a context for the lifetime
- paralleltest # too anoying
- mnd # too annoying
issues:
include:
- EXC0015 # warn for lack of package comment
- EXC0013 # warn for lack of package comment
- EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments
- EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments
exclude-dirs:
- infra/builds
- node_modules
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gocyclo
- dupl
- gosec
- forcetypeassert
- gochecknoglobals
- lll
- err113
- revive
- perfsprint
- wrapcheck
- nlreturn
- varnamelen
- errcheck
- nilnil
- path: infra
linters:
- mnd
- interfacebloat
- goconst
- path: migrations
linters:
- unused
- unparam
- lll
- path: lambda
linters:
- nilnil
- path: magefiles
linters:
- mnd
- err113
- goconst
- wrapcheck
- path: e2e
linters:
- mnd
- err113
- goconst
- wrapcheck
- protogetter