-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path.golangci.yml
More file actions
142 lines (142 loc) · 3.38 KB
/
Copy path.golangci.yml
File metadata and controls
142 lines (142 loc) · 3.38 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"
run:
issues-exit-code: 1
output:
formats:
text:
path: stdout
print-linter-name: true
print-issued-lines: true
linters:
default: none
enable:
- depguard
- exhaustive
- goconst
- gocyclo
- gosec
- govet
- ineffassign
- lll
- paralleltest
- promlinter
- revive
- staticcheck
- thelper
- tparallel
- unparam
- unused
settings:
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax
files:
- $all
- '!$test'
deny:
- pkg: io/ioutil
desc: this is deprecated
gocyclo:
min-complexity: 15
gosec:
excludes:
- G115 # integer overflow conversion — false positives on term.IsTerminal(int(fd))
- G117 # struct field matches secret pattern — false positives on internal types
- G601
- G704 # SSRF via taint analysis — false positive on internal HTTP client wrapper
- G706 # log injection via taint analysis — false positives on standard error logging
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
- goconst
path: (.+)_test\.go
# Test helper / fixture files are not named *_test.go but contain
# the same kind of repeated literal data that goconst flags noisily.
- linters:
- goconst
path: (test_helpers|testutils.*)\.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$
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/stacklok/toolhive-registry-server)
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$