-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.golangci.yml
More file actions
137 lines (135 loc) · 5.01 KB
/
Copy path.golangci.yml
File metadata and controls
137 lines (135 loc) · 5.01 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
# Visit https://golangci-lint.run/ for usage documentation
# and information on other useful linters
version: "2"
issues:
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard # Go standard library
- default # All other external dependencies
- localmodule # This repository's modules
linters:
default: none
enable:
- depguard
- durationcheck
- errcheck
- copyloopvar
- forcetypeassert
- godot
- ineffassign
- makezero
- misspell
- nilerr
- predeclared
- staticcheck
- usetesting
- unconvert
- unparam
- unused
- govet
- testifylint
- thelper
settings:
depguard:
rules:
client:
files:
- "**/client/**/*.go"
- "!$test"
list-mode: strict
allow:
- $gostd
- github.com/meshcloud/terraform-provider-meshstack/client
client-test:
files:
- "**/client/**/*_test.go"
list-mode: strict
allow:
- $gostd
- github.com/meshcloud/terraform-provider-meshstack/client
- github.com/stretchr/testify
provider:
files:
- "!$test"
- "!**/client/**/*.go"
- "!**/internal/clientmock/*.go"
- "!**/internal/provider/acctest/**/*.go"
- "!**/examples/*.go"
list-mode: strict
deny:
- pkg: log # as $gostd is allowed
desc: Always use 'hclog' or SDK logging
- pkg: github.com/meshcloud/terraform-provider-meshstack/internal/clientmock
desc: clientmock package must only be used in tests
allow:
- $gostd
# explicitly specifying 'client' and 'internal' suffixes
# prevents 'examples' package to be included in non-test files
- github.com/meshcloud/terraform-provider-meshstack/client
- github.com/meshcloud/terraform-provider-meshstack/internal
- github.com/hashicorp/terraform-plugin-framework/
- github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry
- github.com/hashicorp/terraform-plugin-framework-jsontypes/jsontypes # for 'any' value support
- github.com/hashicorp/terraform-plugin-framework-validators
- github.com/hashicorp/terraform-plugin-framework-timeouts # for resource timeouts block
- github.com/hashicorp/terraform-plugin-go
- github.com/hashicorp/terraform-plugin-log
- github.com/gabriel-vasile/mimetype
provider-test:
files:
- "$test"
- "**/internal/clientmock/**/*.go"
- "**/internal/provider/acctest/**/*.go"
- "**/examples/*.go"
- "!**/internal/types/**/*.go"
- "!**/client/*_test.go"
- "!**/client/**/*_test.go"
- "!**/internal/provider/provider_test.go" # contains common adapters for all tests, using non-testing deps.
list-mode: strict
deny:
- pkg: github.com/meshcloud/terraform-provider-meshstack/client/internal
desc: Do not use client/internal in provider tests
allow:
- $gostd
- github.com/meshcloud/terraform-provider-meshstack # any packages are included in tests
- github.com/hashicorp/terraform-plugin-testing
- github.com/hashicorp/terraform-plugin-framework/diag
- github.com/hashicorp/hcl/v2 # hclwrite-based config manipulation in examples/
- github.com/zclconf/go-cty/cty # hclwrite value types
- github.com/stretchr/testify
types:
files:
- "**/internal/types/**/*.go"
- "!$test"
list-mode: strict
deny:
- pkg: log # as $gostd is allowed
desc: Always use 'hclog' or SDK logging
allow:
- $gostd
- github.com/meshcloud/terraform-provider-meshstack/client/types # only types should be used from client, if at all!
- github.com/meshcloud/terraform-provider-meshstack/internal/util/
- github.com/meshcloud/terraform-provider-meshstack/internal/types/
- github.com/hashicorp/terraform-plugin-framework/
- github.com/hashicorp/terraform-plugin-go/tftypes
types-test:
files:
- "**/internal/types/**/*_test.go"
list-mode: strict
deny:
- pkg: log # as $gostd is allowed
desc: Always use 'hclog' or SDK logging
allow:
- $gostd
- github.com/meshcloud/terraform-provider-meshstack/internal/util/
- github.com/meshcloud/terraform-provider-meshstack/internal/types/
- github.com/hashicorp/terraform-plugin-framework/
- github.com/hashicorp/terraform-plugin-framework-jsontypes/jsontypes
- github.com/hashicorp/terraform-plugin-go/tftypes
- github.com/stretchr/testify