forked from shellhub-io/shellhub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
86 lines (75 loc) · 2.49 KB
/
.golangci.yaml
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
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
sort-results: true
linters-settings:
depguard:
list-type: blacklist
include-go-root: true
packages:
- github.com/satori/go.uuid
- github.com/dgrijalva/jwt-go
packages-with-error-message:
- github.com/satori/go.uuid: "Uuid generation is only allowed using 'github.com/shellhub-io/shellhub/pkg/uuid'"
- github.com/dgrijalva/jwt-go: "dgrijalva/jwt-go is deprecated please use 'github.com/golang-jwt/jwt'"
stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.16"
# https://staticcheck.io/docs/options#checks
checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
# 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" ]
unused:
# Select the Go version to target. The default is '1.13'.
go: "1.16"
whitespace:
multi-if: true # Enforces newlines (or comments) after every multi-line if statement
multi-func: true # Enforces newlines (or comments) after every multi-line function signature
linters:
enable-all: true
disable:
- bodyclose
- cyclop
- dupl
- errorlint
- exhaustivestruct
- funlen
- gci
- gocognit
- godox
- goerr113
- golint
- gomnd
- interfacer
- lll
- maligned
- noctx
- paralleltest
- testpackage
- wrapcheck
- wsl
# we use it inside pkg/
- gochecknoinits
- gochecknoglobals
issues:
exclude:
# govet: unkeyed fields use
- composite
- Using the variable on range scope `tc` in function literal
exclude-rules:
- linters:
- staticcheck
# TODO: We should rework the code to avoid this issue; this will be done
# during more deep code rework so for now, we'll skip it.
text: "SA1029:"
- linters:
- govet
# validate is unknown but it is a valid tag.
text: "structtag: struct field tag .* validate:"