Skip to content

Commit 572ca37

Browse files
committed
chore: upgrade to golangci-lint v2
Upgrades to golangci-lint configuration to support v2. Signed-off-by: Ryan Johnson <[email protected]>
1 parent 1bd01d4 commit 572ca37

File tree

1 file changed

+53
-32
lines changed

1 file changed

+53
-32
lines changed

Diff for: .golangci.yml

+53-32
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
1-
# © Broadcom. All Rights Reserved.
2-
# The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
3-
# SPDX-License-Identifier: MPL-2.0
1+
---
2+
version: "2"
43

5-
# For more information about the golangci-lint configuration file, refer to:
6-
# https://golangci-lint.run/usage/configuration/
7-
8-
issues:
9-
max-same-issues: 0
10-
exclude-rules:
11-
# Exclude errcheck for some rules.
12-
- linters: [errcheck]
13-
text: "Error return value of `d.Set` is not checked"
14-
# Exclude revive for some rules.
15-
- linters:
16-
- revive
17-
text: 'redefines-builtin-id: redefinition of the built-in'
18-
19-
run:
20-
timeout: 5m
4+
output:
5+
formats:
6+
text:
7+
path: stdout
218

229
linters:
23-
disable-all: true
10+
default: none
2411
enable:
2512
- errcheck
26-
- gofmt
27-
- goimports
28-
- gosimple
2913
- gosec
3014
- govet
3115
- ineffassign
@@ -34,14 +18,51 @@ linters:
3418
- staticcheck
3519
- unconvert
3620
- unused
21+
settings:
22+
errcheck:
23+
exclude-functions:
24+
- github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set
25+
- fmt:.*
26+
- io:Close
27+
exclusions:
28+
generated: lax
29+
presets:
30+
- comments
31+
- common-false-positives
32+
- legacy
33+
- std-error-handling
34+
rules:
35+
# TODO: Setting temporary exclusions for specific linters.
36+
- linters:
37+
- errcheck
38+
text: Error return value of `d.Set` is not checked
39+
- linters:
40+
- revive
41+
text: 'redefines-builtin-id: redefinition of the built-in'
42+
- linters:
43+
- staticcheck
44+
text: 'QF1011: could omit type \*schema.Provider from declaration; it will be inferred from the right-hand side'
45+
- linters:
46+
- staticcheck
47+
text: 'QF1003: could use tagged switch on newNum'
48+
- linters:
49+
- staticcheck
50+
text: 'QF1004: could use strings.ReplaceAll instead'
51+
paths:
52+
- third_party$
53+
- builtin$
54+
- examples$
3755

38-
output:
39-
formats:
40-
- format: colored-line-number
56+
issues:
57+
max-same-issues: 0
4158

42-
linters-settings:
43-
errcheck:
44-
exclude-functions:
45-
- "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set"
46-
- "fmt:.*"
47-
- "io:Close"
59+
formatters:
60+
enable:
61+
- gofmt
62+
- goimports
63+
exclusions:
64+
generated: lax
65+
paths:
66+
- third_party$
67+
- builtin$
68+
- examples$

0 commit comments

Comments
 (0)