-
Notifications
You must be signed in to change notification settings - Fork 16
/
.golangci.yaml
65 lines (59 loc) · 1.54 KB
/
.golangci.yaml
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
run:
timeout: 5m
modules-download-mode: readonly
issues:
exclude-dirs:
- scripts/mockserver
linters:
enable:
- asasalint
- asciicheck
- bidichk
- depguard
- durationcheck
# - exhaustive
- copyloopvar
- forbidigo
- gocritic
- gocheckcompilerdirectives
- gosec
- makezero
- nilerr
- nolintlint
- reassign
- sqlclosecheck
- unconvert
linters-settings:
nolintlint:
require-explanation: true
require-specific: true
forbidigo:
forbid:
- "^(fmt\\.Print(|f|ln)|print|println)$"
- "^(fmt\\.Fprint(|f|ln)|print|println)$"
- '^zap\.Error$'
- '^grpc\.(Header|Trailer)$' # easy to misuse and create a data race
gocritic:
disabled-checks:
- ifElseChain # style
- singleCaseSwitch # style & it's actually not a bad idea to use single case switch in some cases
- assignOp # style
- commentFormatting # style
depguard:
rules:
# Name of a rule.
main:
# List of file globs that will match this list of settings to compare against.
# Default: $all
# files:
# - "!**/*_a _file.go"
# List of allowed packages.
# allow:
# - $gostd
# - github.com/OpenPeeDeeP
# Packages that are not allowed where the value is a suggestion.
deny:
- pkg: "go.uber.org/zap"
desc: Do not use Uber zap, use slog instead
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package