-
Notifications
You must be signed in to change notification settings - Fork 4
/
.golangci.yml
130 lines (121 loc) Β· 3.01 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
run:
timeout: 5m
skip-dirs-use-default: true
skip-dirs:
- hack/bin
- testdata$
- examples$
- internal/static
skip-files:
- "zz_*"
- ".*test.go"
modules-download-mode: readonly
allow-parallel-runners: true
issues:
exclude:
- G101 # gosec: Potential hardcoded credentials
max-same-issues: 0
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# exclude ineffassing linter for generated files for conversion
- linters:
- dogsled
text: "declaration has 3 blank identifiers"
path: _test\.go
- linters:
- dupl
path: _test\.go
- linters:
- goheader
source: "^//go:build"
- linters:
- goheader
text: "Helm"
- linters:
- goheader
text: "Kubernetes"
- linters:
- goheader
text: "SPDX-License-Identifier"
- linters:
- goheader
text: "Authors"
- linters:
- goheader
text: "Copyright"
linters:
disable-all: true
enable:
# - goerr113
- gofmt
- goimports
- gosec
# - goconst
# - gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
- unused
- goheader
# - lll
- whitespace
- vet
# - errcheck
# - nilerr
# - unconvert
linters-settings:
gosimple:
go: "1.21"
gofmt:
simplify: false
golint:
minConfidence: 0
unused:
go: "1.21"
govet:
enable-all: true
disable:
- fieldalignment
- shadow
stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.21"
# https://staticcheck.io/docs/options#checks
checks: [ "all", "-S1*", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-SA5011", "-SA1019", "-SA2002"]
# https://staticcheck.io/docs/options#dot_import_whitelist
dot-import-whitelist:
- fmt
# https://staticcheck.io/docs/options#initialisms
initialisms: [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS" ]
# https://staticcheck.io/docs/options#http_status_code_whitelist
http-status-code-whitelist: [ "200", "400", "404", "500" ]
nakedret:
# default 30
max-func-lines: 100
gocyclo:
# default 30
max-complexity: 100
goheader:
template-path: .go-header.txt
revive:
ignore-generated: true
ignore-generated-header: true
severity: warning
rules:
- name: unused-parameter
disabled: true
errcheck:
check-type-assertions: false
check-blank: true
ignore: fmt:.*
exclude-functions:
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
# use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: latest