-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
104 lines (97 loc) · 2.58 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
run:
deadline: 5m
issues-exit-code: 1
tests: true
modules-download-mode: readonly
allow-parallel-runners: true
skip-dirs:
- apis
- pkg/client
- vendor
- test
# skip-files:
# - ".*\\.my\\.go$"
# - lib/bad.go
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters-settings:
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
gosimple:
go: "1.18"
unused:
go: "1.18"
govet:
enable-all: true
disable:
- fieldalignment
- shadow
stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.18"
# 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
linters:
fast: false
disable-all: true
enable:
# TODO Enforce the below linters later
- deadcode
- gofmt
- govet
- goimports
- ineffassign
- misspell
- vet
- unconvert
issues:
exclude:
# staticcheck
- 'SA1019: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead'
# gosec: Potential hardcoded credentials
- G101
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"