-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
103 lines (100 loc) · 2.41 KB
/
Copy path.golangci.yml
File metadata and controls
103 lines (100 loc) · 2.41 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
version: "2"
run:
timeout: 5m
tests: true
linters:
enable:
- govet
- errcheck
- staticcheck
- unused
- revive
- gosec
- gocyclo
- depguard
- dupl
- funlen
- gocognit
- nestif
- maintidx
- errname
- unparam
- bodyclose
- forcetypeassert
- asasalint
- prealloc
settings:
depguard:
rules:
Main:
deny:
- pkg: "sigs.k8s.io/structured-merge-diff/v4"
desc: "use sigs.k8s.io/structured-merge-diff/v6 instead"
- pkg: "github.com/pkg/errors"
desc: "use github.com/bborbe/errors instead"
- pkg: "github.com/bborbe/argument"
desc: "use github.com/bborbe/argument/v2 instead"
- pkg: "golang.org/x/net/context"
desc: "use context from standard library instead"
- pkg: "golang.org/x/lint/golint"
desc: "deprecated, use revive or staticcheck instead"
- pkg: "io/ioutil"
desc: "deprecated since Go 1.16, use io and os packages instead"
funlen:
lines: 80
statements: 50
gocognit:
min-complexity: 20
nestif:
min-complexity: 4
maintidx:
min-maintainability-index: 20
errcheck:
# Match legacy standalone Makefile `-ignore '(Close|Write|Fprint)'` flag.
exclude-functions:
- (io.Closer).Close
- (*os.File).Close
- (io.Writer).Write
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
gosec:
# Match legacy standalone Makefile `-exclude=G104` flag.
# G104 (unhandled errors) is covered by errcheck above — avoid double-reporting.
excludes:
- G104
exclusions:
presets:
- comments
- std-error-handling
- common-false-positives
rules:
- linters:
- staticcheck
text: "SA1019"
- linters:
- revive
path: "_test\\.go$"
text: "dot-imports"
- linters:
- revive
text: "unused-parameter"
- linters:
- revive
text: "exported"
- linters:
- dupl
path: "_test\\.go$"
- linters:
- dupl
path: "command/task/.*-sender\\.go$"
- linters:
- dupl
path: "healthcheck/healthcheck-.*-step\\.go$"
- linters:
- unparam
path: "_test\\.go$"
formatters:
enable:
- gofmt
- goimports