Skip to content

Commit 2206188

Browse files
committed
chore: upgrade to golangci-lint v2
- Upgrades to golangci-lint configuration to support v2. - Updates workflow to v7 that supports v2. Signed-off-by: Ryan Johnson <[email protected]>
1 parent adde7bd commit 2206188

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

.github/workflows/golangci-lint.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
---
12
name: golangci-lint
23

34
on:
45
pull_request:
56
paths-ignore:
6-
- 'README.md'
7+
- README.md
78
push:
89
paths-ignore:
9-
- 'README.md'
10+
- README.md
1011

1112
permissions:
1213
contents: read
@@ -22,11 +23,11 @@ jobs:
2223
- name: Setup Go
2324
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2425
with:
25-
go-version-file: 'go.mod'
26+
go-version-file: go.mod
2627
cache: true
2728
- run: go mod download
2829
- run: go build -v .
2930
- name: Run Linters
30-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
31+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3132
with:
3233
version: latest

.golangci.yml

+42-37
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,12 @@
1-
# © Broadcom. All Rights Reserved.
2-
# The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
3-
# SPDX-License-Identifier: MPL-2.0
4-
5-
# For more information about the golangci-lint configuration file, refer to:
6-
# https://golangci-lint.run/usage/configuration/
7-
8-
issues:
9-
max-per-linter: 0
10-
max-same-issues: 0
11-
exclude-rules:
12-
# Exclude errcheck for some rules.
13-
- linters: [errcheck]
14-
text: "Error return value of `d.Set` is not checked"
15-
# Exclude revive for some rules.
16-
- linters:
17-
- revive
18-
text: 'redefines-builtin-id: redefinition of the built-in'
19-
20-
run:
21-
deadline: 5m
22-
1+
version: "2"
2+
output:
3+
formats:
4+
text:
5+
path: stdout
236
linters:
24-
disable-all: true
7+
default: none
258
enable:
269
- errcheck
27-
- gofmt
28-
- goimports
29-
- gosimple
3010
- gosec
3111
- govet
3212
- ineffassign
@@ -35,14 +15,39 @@ linters:
3515
- staticcheck
3616
- unconvert
3717
- unused
38-
39-
output:
40-
formats:
41-
- format: colored-line-number
42-
43-
linters-settings:
44-
errcheck:
45-
exclude-functions:
46-
- "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set"
47-
- "fmt:.*"
48-
- "io:Close"
18+
settings:
19+
errcheck:
20+
exclude-functions:
21+
- github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set
22+
- fmt:.*
23+
- io:Close
24+
exclusions:
25+
generated: lax
26+
presets:
27+
- comments
28+
- common-false-positives
29+
- legacy
30+
- std-error-handling
31+
rules:
32+
- linters:
33+
- errcheck
34+
text: Error return value of `d.Set` is not checked
35+
- linters:
36+
- revive
37+
text: 'redefines-builtin-id: redefinition of the built-in'
38+
paths:
39+
- third_party$
40+
- builtin$
41+
- examples$
42+
issues:
43+
max-same-issues: 0
44+
formatters:
45+
enable:
46+
- gofmt
47+
- goimports
48+
exclusions:
49+
generated: lax
50+
paths:
51+
- third_party$
52+
- builtin$
53+
- examples$

0 commit comments

Comments
 (0)