-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy path.golangci.yml
More file actions
72 lines (65 loc) · 1.82 KB
/
Copy path.golangci.yml
File metadata and controls
72 lines (65 loc) · 1.82 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
version: "2"
linters:
default: none
enable:
# default rules
- errcheck
- govet
- ineffassign
- staticcheck
- unused
# other rules
- asasalint
- asciicheck
- bidichk
- depguard
- durationcheck
- forbidigo
- gocritic
- gocheckcompilerdirectives
- gosec
- makezero
- nilerr
- nolintlint
- reassign
- sqlclosecheck
- unconvert
settings:
nolintlint:
require-explanation: true
require-specific: true
staticcheck:
checks:
- "all"
- "-ST*" # stylecheck: not previously enabled (merged into staticcheck in v2)
- "-QF*" # quickfix suggestions: not previously enabled (merged into staticcheck in v2)
gosec:
excludes:
- G101 # false positives on non-credential string constants
- G602 # false positives on range loops and safe slice access
- G706 # false positives on logging config/environment values
forbidigo:
forbid:
- pattern: "^(fmt\\.Print(|f|ln)|print|println)$"
- pattern: "^(fmt\\.Fprint(|f|ln)|print|println)$"
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:
main:
deny:
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package
exclusions:
presets:
- std-error-handling # errcheck: unchecked Close/Remove/print calls
- common-false-positives # gosec: G103, G204, G304 false positives
- legacy # gosec: G104, G301, G302, G307
paths:
- "tests/acceptance"
run:
timeout: 5m