Skip to content

Commit c62c1ce

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 0c89523 commit c62c1ce

File tree

2 files changed

+94
-68
lines changed

2 files changed

+94
-68
lines changed

Diff for: .github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ jobs:
2727
- run: go mod download
2828
- run: go build -v .
2929
- name: Run Linters
30-
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
30+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3131
with:
3232
version: latest

Diff for: .golangci.yml

+93-67
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,5 @@
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-
exclude-rules:
10-
- path: _test\.go
11-
linters:
12-
- dogsled
13-
- funlen
14-
- gocognit
15-
- path: internal/authctx
16-
linters:
17-
- gosec
18-
- nestif
19-
- path: flatten_test.go
20-
linters:
21-
- dupl
22-
23-
linters:
24-
disable-all: true
25-
enable:
26-
- asciicheck
27-
- bodyclose
28-
- copyloopvar
29-
- dogsled
30-
- dupl
31-
- errcheck
32-
- funlen
33-
- goconst
34-
- gocognit
35-
- gocritic
36-
- gocyclo
37-
- godot
38-
- gofmt
39-
- goimports
40-
- goprintffuncname
41-
- gosec
42-
- gosimple
43-
- govet
44-
- ineffassign
45-
- misspell
46-
- nakedret
47-
- nestif
48-
- prealloc
49-
- staticcheck
50-
- stylecheck
51-
- typecheck
52-
- unconvert
53-
- unparam
54-
- unused
55-
- whitespace
56-
- wsl
1+
---
2+
version: "2"
573

584
run:
595
build-tags:
@@ -86,15 +32,95 @@ run:
8632

8733
output:
8834
formats:
89-
- format: colored-line-number
35+
text:
36+
path: stdout
9037

91-
linters-settings:
92-
funlen:
93-
lines: 150
94-
statements: 100
95-
gocognit:
96-
min-complexity: 60
97-
goimports:
98-
local-prefixes: github.com/vmware/terraform-provider-tanzu-mission-control
99-
nestif:
100-
min-complexity: 14
38+
linters:
39+
default: none
40+
enable:
41+
- asciicheck
42+
- bodyclose
43+
- copyloopvar
44+
- dogsled
45+
- dupl
46+
- errcheck
47+
- funlen
48+
- gocognit
49+
- goconst
50+
- gocritic
51+
- gocyclo
52+
- godot
53+
- goprintffuncname
54+
- gosec
55+
- govet
56+
- ineffassign
57+
- misspell
58+
- nakedret
59+
- nestif
60+
- prealloc
61+
- staticcheck
62+
- unconvert
63+
- unparam
64+
- unused
65+
- whitespace
66+
- wsl
67+
settings:
68+
funlen:
69+
lines: 150
70+
statements: 100
71+
gocognit:
72+
min-complexity: 60
73+
nestif:
74+
min-complexity: 14
75+
exclusions:
76+
generated: lax
77+
presets:
78+
- comments
79+
- common-false-positives
80+
- legacy
81+
- std-error-handling
82+
rules:
83+
# TODO: Setting temporary exclusions.
84+
- linters:
85+
- dogsled
86+
- funlen
87+
- gocognit
88+
path: _test\.go
89+
- linters:
90+
- gosec
91+
- nestif
92+
path: internal/authctx
93+
- linters:
94+
- dupl
95+
path: flatten_test.go
96+
- linters:
97+
- staticcheck
98+
text: QF1001
99+
- linters:
100+
- staticcheck
101+
text: QF1003
102+
- linters:
103+
- staticcheck
104+
text: QF1007
105+
- linters:
106+
- staticcheck
107+
text: QF1011
108+
paths:
109+
- third_party$
110+
- builtin$
111+
- examples$
112+
113+
formatters:
114+
enable:
115+
- gofmt
116+
- goimports
117+
settings:
118+
goimports:
119+
local-prefixes:
120+
- github.com/vmware/terraform-provider-tanzu-mission-control
121+
exclusions:
122+
generated: lax
123+
paths:
124+
- third_party$
125+
- builtin$
126+
- examples$

0 commit comments

Comments
 (0)