forked from nutanix/terraform-provider-nutanix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
76 lines (73 loc) · 2.36 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
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
maligned:
suggest-new: true
goconst:
min-len: 2
min-occurrences: 2
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
misspell:
locale: US
lll:
# Default is 120. '\t' is counted as 1 character.
# set our project to 200, as things like v3_structs with inline comments end up being a touch long
# also, for anyone using vscode, use the following configs:
# "rewrap.wrappingColumn": 200 ... requires the rewrap plugin
# "editor.rulers": [200]
line-length: 200
linters:
enable-all: true
disable:
- gocyclo
# disabled gocyclo as we do have a lot of large methods to iterate thru the large JSON specs
- dupl
# disabled dupl as we do have a lot of duplicated code between resources and their tests, which gets flagged by this
- errcheck
# errocheck disabled to silience errors here: https://travis-ci.com/nutanix/terraform-provider-nutanix/jobs/131154435
# Example error:
# nutanix/data_source_nutanix_image.go:61:7: Error return value of `d.Set` is not checked (errcheck)
# d.Set("name", utils.StringValue(resp.Status.Name))
# waiting on terraform/hashi to let us know how they want us to changle those errors
# see Error return value of `d.Set` is not checked (errcheck)
- typecheck
- gosec
- gochecknoinits
- gochecknoglobals
- funlen
- gocognit
- godox
- wsl
- nestif
- godot
- goconst
- unparam
- unused
- staticcheck
- deadcode
issues:
exclude:
- composite literal uses unkeyed fields
exclude-rules:
- path: _test\.go
linters:
- testpackage
# part of the golangci govet package is picking up things that go vet doesn't. Seems flaky, shutting that specific error off
- path: client/client.go
linters:
- interfacer
# interfacer lint on `filter` func suggests lint changes that dont compile
# Details: linter suggests to convert `body` param to io.Reader since we don't use Close method, but return type requires
## io.ReadCloser thus failing to compile
run:
# which dirs to skip: they won't be analyzed;
skip-dirs:
- vendor
- future