Skip to content

Commit bb31189

Browse files
Bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 (#278)
* Bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.2 to 7.0.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@55c2c14...1481404) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * upgraded golangci image version to v2 * migrated golanci.yaml file * disabled type naming convetion check due to CRD name in linter * linter config fixes * removed .golangci.bck.yaml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Fabian Schulz <[email protected]>
1 parent b177eef commit bb31189

File tree

3 files changed

+117
-105
lines changed

3 files changed

+117
-105
lines changed

.github/workflows/lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
with:
1818
go-version: 1.24.2
1919
- name: golangci-lint
20-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
20+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
2121
with:
22-
version: v1.64.6
22+
version: v2.1.2
2323
args: --config tools/.golangci.yaml
2424
- run: |
2525
set -euo pipefail

pkg/netbox/api/ip_range_claim_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ func TestIPRangeClaim(t *testing.T) {
4646
ipRangeV4_7 := "10.112.140.7/24"
4747
ipRangeV4_8 := "10.112.140.8/24"
4848

49-
expectedIp_5 := "10.112.140.5/32"
50-
expectedIp_7 := "10.112.140.7/32"
49+
expectedIpDot5 := "10.112.140.5/32"
50+
expectedIpDot7 := "10.112.140.7/32"
5151

5252
// example of available IPv4 ip adress
5353
availableIpAdressesIPv4 := func() []*netboxModels.AvailableIP {
@@ -144,8 +144,8 @@ func TestIPRangeClaim(t *testing.T) {
144144
// assert error
145145
AssertNil(t, err)
146146
// assert nil output
147-
assert.Equal(t, expectedIp_5, actual.StartAddress)
148-
assert.Equal(t, expectedIp_7, actual.EndAddress)
147+
assert.Equal(t, expectedIpDot5, actual.StartAddress)
148+
assert.Equal(t, expectedIpDot7, actual.EndAddress)
149149
})
150150

151151
t.Run("Fail first available IP range by claim (IPv6) if not enough consequiteve ips.", func(t *testing.T) {
@@ -225,8 +225,8 @@ func TestIPRangeClaim(t *testing.T) {
225225
Previous: nil,
226226
Results: []*netboxModels.IPRange{
227227
{
228-
StartAddress: &expectedIp_5,
229-
EndAddress: &expectedIp_7,
228+
StartAddress: &expectedIpDot5,
229+
EndAddress: &expectedIpDot7,
230230
},
231231
},
232232
},
@@ -246,8 +246,8 @@ func TestIPRangeClaim(t *testing.T) {
246246
actual, err := client.RestoreExistingIpRangeByHash(input)
247247

248248
assert.Nil(t, err)
249-
assert.Equal(t, expectedIp_5, actual.StartAddress)
250-
assert.Equal(t, expectedIp_7, actual.EndAddress)
249+
assert.Equal(t, expectedIpDot5, actual.StartAddress)
250+
assert.Equal(t, expectedIpDot7, actual.EndAddress)
251251
})
252252

253253
t.Run("Fail reclaim IP Range if multiple results returned", func(t *testing.T) {
@@ -260,12 +260,12 @@ func TestIPRangeClaim(t *testing.T) {
260260
Previous: nil,
261261
Results: []*netboxModels.IPRange{
262262
{
263-
StartAddress: &expectedIp_5,
264-
EndAddress: &expectedIp_7,
263+
StartAddress: &expectedIpDot5,
264+
EndAddress: &expectedIpDot7,
265265
},
266266
{
267-
StartAddress: &expectedIp_5,
268-
EndAddress: &expectedIp_7,
267+
StartAddress: &expectedIpDot5,
268+
EndAddress: &expectedIpDot7,
269269
},
270270
},
271271
},

tools/.golangci.yaml

Lines changed: 103 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,115 @@
1-
---
2-
run:
3-
timeout: 30m
4-
issues:
5-
max-same-issues: 0
6-
exclude-files:
7-
- ^zz_generated.*
1+
version: "2"
82
linters:
9-
disable-all: true
3+
default: none
104
enable:
11-
- goimports
5+
- goheader
126
- ineffassign
137
- nakedret
148
- revive
159
- staticcheck
16-
- stylecheck
1710
- unconvert
1811
- unparam
1912
- unused
20-
- goheader
21-
linters-settings:
22-
staticcheck:
23-
checks:
24-
- "all"
25-
- "-SA1019" # Using a deprecated function, variable, constant or field
26-
- "-SA2002" # Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
27-
stylecheck:
28-
checks:
29-
- "ST1019" # Importing the same package multiple times
30-
revive:
31-
ignore-generated-header: false
32-
severity: error
33-
confidence: 0.8
34-
enable-all-rules: false
35-
rules:
36-
# we specify rules we would like to enable
37-
- name: blank-imports
38-
severity: error
39-
disabled: false
40-
- name: context-as-argument
41-
severity: error
42-
disabled: false
43-
- name: dot-imports
44-
severity: error
45-
disabled: true
46-
- name: error-return
47-
severity: error
48-
disabled: false
49-
- name: error-naming
50-
severity: error
51-
disabled: false
52-
- name: if-return
53-
severity: error
54-
disabled: false
55-
- name: increment-decrement
56-
severity: error
57-
disabled: false
58-
- name: var-declaration
59-
severity: error
60-
disabled: false
61-
- name: package-comments
62-
severity: error
63-
disabled: false
64-
- name: range
65-
severity: error
66-
disabled: false
67-
- name: receiver-naming
68-
severity: error
69-
disabled: false
70-
- name: time-naming
71-
severity: error
72-
disabled: false
73-
- name: indent-error-flow
74-
severity: error
75-
disabled: false
76-
- name: errorf
77-
severity: error
78-
disabled: false
79-
- name: context-keys-type
80-
severity: error
81-
disabled: false
82-
- name: error-strings
83-
severity: error
84-
disabled: false
85-
# https://golangci-lint.run/usage/linters/#goheader
86-
goheader:
87-
values:
88-
regexp:
89-
AUTHOR: ^Copyright 2024 (The Kubernetes authors|Swisscom \(Schweiz\) AG)\.
90-
template: |-
91-
{{ AUTHOR }}
13+
settings:
14+
goheader:
15+
values:
16+
regexp:
17+
AUTHOR: ^Copyright 2024 (The Kubernetes authors|Swisscom \(Schweiz\) AG)\.
18+
template: |-
19+
{{ AUTHOR }}
9220
93-
Licensed under the Apache License, Version 2.0 (the "License");
94-
you may not use this file except in compliance with the License.
95-
You may obtain a copy of the License at
21+
Licensed under the Apache License, Version 2.0 (the "License");
22+
you may not use this file except in compliance with the License.
23+
You may obtain a copy of the License at
9624
97-
http://www.apache.org/licenses/LICENSE-2.0
25+
http://www.apache.org/licenses/LICENSE-2.0
9826
99-
Unless required by applicable law or agreed to in writing, software
100-
distributed under the License is distributed on an "AS IS" BASIS,
101-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
102-
See the License for the specific language governing permissions and
103-
limitations under the License.
27+
Unless required by applicable law or agreed to in writing, software
28+
distributed under the License is distributed on an "AS IS" BASIS,
29+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30+
See the License for the specific language governing permissions and
31+
limitations under the License.
32+
revive:
33+
confidence: 0.8
34+
severity: error
35+
enable-all-rules: false
36+
rules:
37+
- name: blank-imports
38+
severity: error
39+
disabled: false
40+
- name: context-as-argument
41+
severity: error
42+
disabled: false
43+
- name: dot-imports
44+
severity: error
45+
disabled: true
46+
- name: error-return
47+
severity: error
48+
disabled: false
49+
- name: error-naming
50+
severity: error
51+
disabled: false
52+
- name: if-return
53+
severity: error
54+
disabled: false
55+
- name: increment-decrement
56+
severity: error
57+
disabled: false
58+
- name: var-declaration
59+
severity: error
60+
disabled: false
61+
- name: package-comments
62+
severity: error
63+
disabled: false
64+
- name: range
65+
severity: error
66+
disabled: false
67+
- name: receiver-naming
68+
severity: error
69+
disabled: false
70+
- name: time-naming
71+
severity: error
72+
disabled: false
73+
- name: indent-error-flow
74+
severity: error
75+
disabled: false
76+
- name: errorf
77+
severity: error
78+
disabled: false
79+
- name: context-keys-type
80+
severity: error
81+
disabled: false
82+
- name: error-strings
83+
severity: error
84+
disabled: false
85+
staticcheck:
86+
# removed: "IP", "HTTPS", "URL" from defaults
87+
initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
88+
checks:
89+
- all
90+
- -QF1008
91+
- -QF1003
92+
exclusions:
93+
generated: lax
94+
presets:
95+
- comments
96+
- common-false-positives
97+
- legacy
98+
- std-error-handling
99+
paths:
100+
- ^zz_generated.*
101+
- third_party$
102+
- builtin$
103+
- examples$
104+
issues:
105+
max-same-issues: 0
106+
formatters:
107+
enable:
108+
- goimports
109+
exclusions:
110+
generated: lax
111+
paths:
112+
- ^zz_generated.*
113+
- third_party$
114+
- builtin$
115+
- examples$

0 commit comments

Comments
 (0)