Skip to content

Commit ad3c2a7

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 3110544 commit ad3c2a7

File tree

2 files changed

+96
-68
lines changed

2 files changed

+96
-68
lines changed

.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

.golangci.yml

+95-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,97 @@ 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+
- linters:
84+
- dogsled
85+
- funlen
86+
- gocognit
87+
path: _test\.go
88+
- linters:
89+
- gosec
90+
- nestif
91+
path: internal/authctx
92+
- linters:
93+
- dupl
94+
path: flatten_test.go
95+
- linters:
96+
- staticcheck
97+
text: 'QF1001'
98+
- linters:
99+
- staticcheck
100+
text: 'QF1003'
101+
- linters:
102+
- staticcheck
103+
text: 'QF1003'
104+
- linters:
105+
- staticcheck
106+
text: 'QF1007'
107+
- linters:
108+
- staticcheck
109+
text: 'QF1011'
110+
paths:
111+
- third_party$
112+
- builtin$
113+
- examples$
114+
115+
formatters:
116+
enable:
117+
- gofmt
118+
- goimports
119+
settings:
120+
goimports:
121+
local-prefixes:
122+
- github.com/vmware/terraform-provider-tanzu-mission-control
123+
exclusions:
124+
generated: lax
125+
paths:
126+
- third_party$
127+
- builtin$
128+
- examples$

0 commit comments

Comments
 (0)