-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.golangci.yaml
More file actions
142 lines (142 loc) · 3.32 KB
/
.golangci.yaml
File metadata and controls
142 lines (142 loc) · 3.32 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
version: "2"
linters:
enable:
- asciicheck
- copyloopvar
- dogsled
- durationcheck
- errorlint
- exhaustive
- goconst
- gomodguard
- gosec
- importas
- lll
- misspell
- nakedret
- nilerr
- nolintlint
- prealloc
- predeclared
- revive
- staticcheck
- testifylint
- unconvert
- unparam
- wastedassign
settings:
goconst:
min-occurrences: 10
gomodguard:
blocked:
modules:
- github.com/ghodss/yaml:
recommendations:
- sigs.k8s.io/yaml
- gopkg.in/yaml.v2:
recommendations:
- sigs.k8s.io/yaml
- gopkg.in/yaml.v3:
recommendations:
- sigs.k8s.io/yaml
- github.com/pkg/errors:
recommendations:
- fmt
- errors
- golang.org/x/net/context:
recommendations:
- context
testifylint:
enable-all: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- gosec
path: state/indexers/md5Indexer.*
text: weak cryptographic primitive
- linters:
- gosec
path: _test\.go
text: weak random number generator
- linters:
- errcheck
path: _test\.go
text: Error return value
- linters:
- gosec
path: file/codegen/main.go
text: Expect WriteFile permissions to be 0600 or less
- linters:
- unparam
- unused
path: test_.*
- linters:
- staticcheck
text: SA1019.*
# Exclude gosec G101 (hardcoded credentials) for test files
- linters:
- gosec
path: _test\.go
text: G101
# Exclude gosec G704 (SSRF) for test files where HTTP requests are expected
- linters:
- gosec
path: tests/integration/
text: G704
# Exclude gosec G101 for static entity maps (false positive on entity type names)
- linters:
- gosec
path: (pkg/state/.*|pkg/utils/.*|pkg/schema/fetchers.*)\.go
text: G101
- linters:
- gosec
path: (pkg/state/.*|pkg/utils/.*)\.go
text: G117
# Exclude G704 for files where HTTP requests are expected
- linters:
- gosec
path: (pkg/konnect/client|pkg/konnect/.*_test)\.go
text: G704
# Exclude G115 integer overflow (uintptr -> int for terminal check)
- linters:
- gosec
path: pkg/file/readfile\.go
text: G115
# Exclude revive var-naming for package name warnings
- linters:
- revive
text: "avoid meaningless package names"
# Exclude gomodguard for integration test files
- linters:
- gomodguard
path: tests/integration/
- linters:
- prealloc
path: .*_test\.go
- linters:
- prealloc
path: tests/
paths:
- third_party$
- builtin$
- examples$
issues:
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$