-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy path.golangci.yml
More file actions
170 lines (170 loc) · 4.49 KB
/
.golangci.yml
File metadata and controls
170 lines (170 loc) · 4.49 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
version: "2"
run:
issues-exit-code: 1
output:
formats:
text:
path: stdout
print-linter-name: true
print-issued-lines: true
linters:
default: none
enable:
- depguard
- exhaustive
- ginkgolinter
- goconst
- gocyclo
- gosec
- govet
- ineffassign
- lll
- paralleltest
- promlinter
- revive
- staticcheck
- thelper
- tparallel
- unparam
- unused
- errcheck
settings:
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax
files:
- $all
- '!$test'
deny:
- pkg: io/ioutil
desc: this is deprecated
ginkgolinter:
# Suppress the wrong length assertion warning
suppress-len-assertion: false
# Suppress the wrong nil assertion warning
suppress-nil-assertion: false
# Suppress the wrong error assertion warning
suppress-err-assertion: false
# Suppress the wrong comparison assertion warning
suppress-compare-assertion: false
# Suppress the wrong async assertion warning
suppress-async-assertion: false
# Suppress warning for comparing values from different types
suppress-type-compare-assertion: false
# Forbid focus containers (FIt, FDescribe, etc.)
forbid-focus-container: true
# Force using Expect with To/ToNot instead of Should/ShouldNot
force-expect-to: false
# Validate async intervals (timeout vs polling)
validate-async-intervals: true
# Forbid spec pollution (variable initialization in container nodes)
forbid-spec-pollution: false
# Force using Succeed() for functions and HaveOccurred() for errors
force-succeed: false
gocyclo:
min-complexity: 15
gosec:
excludes:
- G601
# The following rules were introduced in gosec v2.22+ (shipped with
# golangci-lint alongside Go 1.26). They flag pre-existing patterns
# across the codebase. Exclude them here and address in a follow-up PR.
- G117 # Marshaled struct field matches secret pattern
- G118 # Context cancellation / goroutine context issues
- G120 # Form parsing without body size limit
- G122 # Filesystem race in filepath.Walk
- G703 # Path traversal via taint analysis
- G704 # SSRF via taint analysis
- G705 # XSS via taint analysis
- G706 # Log injection via taint analysis
lll:
line-length: 130
revive:
severity: warning
rules:
- name: blank-imports
severity: warning
- name: context-as-argument
- name: context-keys-type
- name: duplicated-imports
- name: error-naming
- name: error-return
- name: exported
severity: error
- name: if-return
- name: identical-branches
- name: indent-error-flow
- name: import-shadowing
- name: package-comments
- name: redefines-builtin-id
- name: struct-tag
- name: unconditional-recursion
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
- name: unused-receiver
- name: unhandled-error
disabled: true
exclusions:
generated: lax
rules:
- linters:
- lll
- gocyclo
- errcheck
- dupl
- gosec
path: (.+)_test\.go
- linters:
- lll
path: .golangci.yml
# These are auto-generated, so it makes no sense including them.
- linters:
- dupl
- errcheck
- gci
- gocyclo
- gosec
- lll
path: (.*)mock_(.+)\.go
# These are auto-generated, so it makes no sense including them.
- linters:
- dupl
- errcheck
- gci
- gocyclo
- gosec
- lll
path: (.*)zz_generated\.deepcopy\.go
# This is auto-generated, so it makes no sense including it.
- linters:
- dupl
- errcheck
- gci
- gocyclo
- gosec
- lll
path: docs/server/docs.go
paths:
- third_party$
- builtin$
- examples$
- scripts$
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/stacklok/toolhive)
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- scripts$