Skip to content

Commit 58d5ca1

Browse files
committed
chore(golangci-lint): migrate to v2
Signed-off-by: Nathanael Liechti <[email protected]>
1 parent 163b756 commit 58d5ca1

File tree

2 files changed

+105
-86
lines changed

2 files changed

+105
-86
lines changed

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
- name: Build provider
2828
run: make build
2929
- name: Run linters
30-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
30+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3131
with:
32-
version: v1.64.6
32+
version: v2.0.2
3333

3434
generate:
3535
runs-on: ubuntu-24.04

.golangci.yml

+103-84
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
issues:
2-
exclude-rules:
3-
- linters:
4-
- paralleltest
5-
text: "Function TestAcc"
6-
- linters:
7-
- tparallel
8-
text: "TestAcc"
9-
- linters:
10-
- unparam
11-
text: "always receives"
12-
- path: _test\.go
13-
linters:
14-
- contextcheck
15-
max-same-issues: 0
16-
1+
version: "2"
172
linters:
18-
disable-all: true
3+
default: none
194
enable:
205
- asasalint
216
- asciicheck
@@ -29,8 +14,6 @@ linters:
2914
- errorlint
3015
- goconst
3116
- gocritic
32-
- gofmt
33-
- gosimple
3417
- govet
3518
- ineffassign
3619
- makezero
@@ -42,75 +25,111 @@ linters:
4225
- paralleltest
4326
- predeclared
4427
- staticcheck
45-
- stylecheck
4628
- tparallel
47-
- typecheck
4829
- unconvert
4930
- unparam
5031
- unused
5132
- usetesting
5233
- whitespace
5334
- wsl
54-
55-
linters-settings:
56-
dogsled:
57-
max-blank-identifiers: 3
58-
errcheck:
59-
exclude-functions:
60-
- github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set
61-
- fmt:.*
62-
- io:Close
63-
errorlint:
64-
errorf: false
65-
goconst:
66-
ignore-tests: true
67-
min-occurrences: 6
68-
gocritic:
69-
enabled-tags:
70-
- diagnostic
71-
disabled-tags:
72-
- style
73-
- performance
74-
- experimental
75-
- opinionated
76-
mnd:
77-
checks:
78-
- argument
79-
ignored-functions:
80-
# Terraform Plugin SDK
81-
- resource.Retry
82-
- schema.DefaultTimeout
83-
- validation.*
84-
# Terraform Plugin Framework
85-
- int64validator.*
86-
- listvalidator.*
87-
- stringvalidator.*
88-
- SetDefaultCreateTimeout
89-
- SetDefaultReadTimeout
90-
- SetDefaultUpdateTimeout
91-
- SetDefaultDeleteTimeout
92-
# Go
93-
- make
94-
- strconv.FormatFloat
95-
- strconv.FormatInt
96-
- strconv.ParseFloat
97-
- strconv.ParseInt
98-
- strings.SplitN
99-
nolintlint:
100-
allow-unused: false
101-
require-explanation: true
102-
require-specific: true
103-
allow-no-explanation:
104-
- gomnd
105-
- paralleltest
106-
- tparallel
107-
- unparam
108-
predeclared:
109-
ignore: cap,close,copy,delete,len,new
110-
staticcheck:
111-
checks: ["all", "-SA1019"]
112-
stylecheck:
113-
checks: ["all", "-ST1005", "-ST1003"]
114-
115-
run:
116-
timeout: 5m
35+
settings:
36+
dogsled:
37+
max-blank-identifiers: 3
38+
errcheck:
39+
exclude-functions:
40+
- github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set
41+
- fmt:.*
42+
- io:Close
43+
errorlint:
44+
errorf: false
45+
goconst:
46+
min-occurrences: 6
47+
gocritic:
48+
enabled-tags:
49+
- diagnostic
50+
disabled-tags:
51+
- style
52+
- performance
53+
- experimental
54+
- opinionated
55+
mnd:
56+
checks:
57+
- argument
58+
ignored-functions:
59+
- resource.Retry
60+
- schema.DefaultTimeout
61+
- validation.*
62+
- int64validator.*
63+
- listvalidator.*
64+
- stringvalidator.*
65+
- SetDefaultCreateTimeout
66+
- SetDefaultReadTimeout
67+
- SetDefaultUpdateTimeout
68+
- SetDefaultDeleteTimeout
69+
- make
70+
- strconv.FormatFloat
71+
- strconv.FormatInt
72+
- strconv.ParseFloat
73+
- strconv.ParseInt
74+
- strings.SplitN
75+
nolintlint:
76+
require-explanation: true
77+
require-specific: true
78+
allow-no-explanation:
79+
- gomnd
80+
- paralleltest
81+
- tparallel
82+
- unparam
83+
allow-unused: false
84+
predeclared:
85+
ignore:
86+
- cap
87+
- close
88+
- copy
89+
- delete
90+
- len
91+
- new
92+
staticcheck:
93+
checks:
94+
- -SA1019
95+
- -ST1003
96+
- -ST1005
97+
- all
98+
exclusions:
99+
generated: lax
100+
presets:
101+
- comments
102+
- common-false-positives
103+
- legacy
104+
- std-error-handling
105+
rules:
106+
- linters:
107+
- paralleltest
108+
text: Function TestAcc
109+
- linters:
110+
- tparallel
111+
text: TestAcc
112+
- linters:
113+
- unparam
114+
text: always receives
115+
- linters:
116+
- contextcheck
117+
path: _test\.go
118+
- linters:
119+
- goconst
120+
path: (.+)_test\.go
121+
paths:
122+
- third_party$
123+
- builtin$
124+
- examples$
125+
issues:
126+
max-same-issues: 0
127+
formatters:
128+
enable:
129+
- gofmt
130+
exclusions:
131+
generated: lax
132+
paths:
133+
- third_party$
134+
- builtin$
135+
- examples$

0 commit comments

Comments
 (0)