Skip to content

Commit 4201766

Browse files
committed
golangci-lint: Fix deprecation warnings
There were a couple of deprecation warnings after bumping golangci-lint version: WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.20) of your project is lower than Go 1.22 WARN [config_reader] The configuration option `run.skip-files` is deprecated, please use `issues.exclude-files`. WARN [config_reader] The configuration option `linters.gci.local-prefixes` is deprecated, please use `prefix()` inside `linters.gci.sections`. WARN [config_reader] The configuration option `linters.staticcheck.go` is deprecated, please use global `run.go`. WARN [config_reader] The configuration option `linters.stylecheck.go` is deprecated, please use global `run.go`.
1 parent 6f4f7be commit 4201766

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.golangci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ linters:
55
- asciicheck
66
- bidichk
77
- bodyclose
8-
- copyloopvar
8+
# Commented out as this linter doesn't work against go 1.20 projects
9+
# - copyloopvar
910
- cyclop
1011
# - depguard
1112
- dogsled
@@ -56,7 +57,10 @@ linters-settings:
5657
# TODO(sbuerin) fix remaining findings and set to 20 afterwards
5758
max-complexity: 30
5859
gci:
59-
local-prefixes: sigs.k8s.io/cluster-api-provider-openstack
60+
sections:
61+
- standard
62+
- default
63+
- prefix(sigs.k8s.io/cluster-api-provider-openstack)
6064
gocritic:
6165
enabled-tags:
6266
- diagnostic
@@ -129,10 +133,6 @@ linters-settings:
129133
nolintlint:
130134
# https://github.com/golangci/golangci-lint/issues/3228
131135
allow-unused: true
132-
staticcheck:
133-
go: "1.20"
134-
stylecheck:
135-
go: "1.20"
136136
nestif:
137137
# minimal complexity of if statements to report, 5 by default
138138
# TODO(sbuerin) fix remaining findings and set to 5 after:
@@ -171,12 +171,13 @@ issues:
171171
- stylecheck
172172
text: "ST1003: should not use underscores in Go names;"
173173
path: .*(api|types)\/.*\/.*conversion.*\.go$
174+
exclude-files:
175+
- "zz_generated.*\\.go$"
174176

175177
run:
176178
timeout: 10m
177179
build-tags:
178180
- e2e
181+
go: "1.20"
179182

180-
skip-files:
181-
- "zz_generated.*\\.go$"
182183
allow-parallel-runners: true

0 commit comments

Comments
 (0)