-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
111 lines (103 loc) · 3.04 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
run:
timeout: 5m
concurrency: 4
linters:
enable:
- bodyclose
- dupl # tool for code clone detection
- durationcheck # checks for two durations multiplied together
- errcheck
- copyloopvar # Unpinned variables
- cyclop
- goconst # finds repeated strings that could be replaced by a constant
- gocritic
- gocognit # computes and checks the cognitive complexity of functions
- gofmt
- goimports
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
- gosec
- gosimple
- govet # runs additional go vet checks
- ineffassign
- lll # reports long lines
- misspell
- nakedret # finds naked returns in functions greater than a specified function length
- nestif # reports deeply nested if statements
- nilerr # finds the code that returns nil even if it checks that the error is not nil
- noctx
- paralleltest
- rowserrcheck # checks whether Err of rows is checked successfully
- spancheck # checks usage and closure of tracing spans
- staticcheck
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
- stylecheck # is a replacement for golint
- unconvert # removes unnecessary type conversions
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
- unparam # reports unused function parameters
- unused
- whitespace # detects leading and trailing whitespace
presets:
- performance
- complexity
linters-settings:
paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
ignore-missing: true
errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
# Such cases aren't reported by default.
# Default: false
check-type-assertions: true
# Disable annoying errcheck warnings that cause people to do weird things with `defer()`
exclude-functions:
- (io.Closer).Close
- (*os.File).Close
govet:
# These govet checks are disabled by default, but they're useful.
enable:
- reflectvaluecompare
- sortslice
- unusedwrite
gocritic:
# These gocritic checks are disabled by default, but they're useful.
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- filepathJoin
- hugeParam
- importShadow
- paramTypeCombine
- rangeValCopy
- unnecessaryBlock
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
- path: "_test\\.go"
linters:
- cyclop
- dupl
- errcheck
- funlen
- gosec
- gocognit
- gocyclo
- lll
- nestif
- nakedret
# Exclude comments from long line linter
- linters:
- lll
source: "^\t*// "
- path: "\\.go"
linters:
- funlen
# Exclude err checking from Fprintf
- linters:
- errcheck
source: "Fprint"