Skip to content

Bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
with:
go-version: 1.24.2
- name: golangci-lint
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
version: v1.64.6
version: v2.1.2
args: --config tools/.golangci.yaml
- run: |
set -euo pipefail
Expand Down
24 changes: 12 additions & 12 deletions pkg/netbox/api/ip_range_claim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func TestIPRangeClaim(t *testing.T) {
ipRangeV4_7 := "10.112.140.7/24"
ipRangeV4_8 := "10.112.140.8/24"

expectedIp_5 := "10.112.140.5/32"
expectedIp_7 := "10.112.140.7/32"
expectedIpDot5 := "10.112.140.5/32"
expectedIpDot7 := "10.112.140.7/32"

// example of available IPv4 ip adress
availableIpAdressesIPv4 := func() []*netboxModels.AvailableIP {
Expand Down Expand Up @@ -144,8 +144,8 @@ func TestIPRangeClaim(t *testing.T) {
// assert error
AssertNil(t, err)
// assert nil output
assert.Equal(t, expectedIp_5, actual.StartAddress)
assert.Equal(t, expectedIp_7, actual.EndAddress)
assert.Equal(t, expectedIpDot5, actual.StartAddress)
assert.Equal(t, expectedIpDot7, actual.EndAddress)
})

t.Run("Fail first available IP range by claim (IPv6) if not enough consequiteve ips.", func(t *testing.T) {
Expand Down Expand Up @@ -225,8 +225,8 @@ func TestIPRangeClaim(t *testing.T) {
Previous: nil,
Results: []*netboxModels.IPRange{
{
StartAddress: &expectedIp_5,
EndAddress: &expectedIp_7,
StartAddress: &expectedIpDot5,
EndAddress: &expectedIpDot7,
},
},
},
Expand All @@ -246,8 +246,8 @@ func TestIPRangeClaim(t *testing.T) {
actual, err := client.RestoreExistingIpRangeByHash(input)

assert.Nil(t, err)
assert.Equal(t, expectedIp_5, actual.StartAddress)
assert.Equal(t, expectedIp_7, actual.EndAddress)
assert.Equal(t, expectedIpDot5, actual.StartAddress)
assert.Equal(t, expectedIpDot7, actual.EndAddress)
})

t.Run("Fail reclaim IP Range if multiple results returned", func(t *testing.T) {
Expand All @@ -260,12 +260,12 @@ func TestIPRangeClaim(t *testing.T) {
Previous: nil,
Results: []*netboxModels.IPRange{
{
StartAddress: &expectedIp_5,
EndAddress: &expectedIp_7,
StartAddress: &expectedIpDot5,
EndAddress: &expectedIpDot7,
},
{
StartAddress: &expectedIp_5,
EndAddress: &expectedIp_7,
StartAddress: &expectedIpDot5,
EndAddress: &expectedIpDot7,
},
},
},
Expand Down
194 changes: 103 additions & 91 deletions tools/.golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,103 +1,115 @@
---
run:
timeout: 30m
issues:
max-same-issues: 0
exclude-files:
- ^zz_generated.*
version: "2"
linters:
disable-all: true
default: none
enable:
- goimports
- goheader
- ineffassign
- nakedret
- revive
- staticcheck
- stylecheck
- unconvert
- unparam
- unused
- goheader
linters-settings:
staticcheck:
checks:
- "all"
- "-SA1019" # Using a deprecated function, variable, constant or field
- "-SA2002" # Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
stylecheck:
checks:
- "ST1019" # Importing the same package multiple times
revive:
ignore-generated-header: false
severity: error
confidence: 0.8
enable-all-rules: false
rules:
# we specify rules we would like to enable
- name: blank-imports
severity: error
disabled: false
- name: context-as-argument
severity: error
disabled: false
- name: dot-imports
severity: error
disabled: true
- name: error-return
severity: error
disabled: false
- name: error-naming
severity: error
disabled: false
- name: if-return
severity: error
disabled: false
- name: increment-decrement
severity: error
disabled: false
- name: var-declaration
severity: error
disabled: false
- name: package-comments
severity: error
disabled: false
- name: range
severity: error
disabled: false
- name: receiver-naming
severity: error
disabled: false
- name: time-naming
severity: error
disabled: false
- name: indent-error-flow
severity: error
disabled: false
- name: errorf
severity: error
disabled: false
- name: context-keys-type
severity: error
disabled: false
- name: error-strings
severity: error
disabled: false
# https://golangci-lint.run/usage/linters/#goheader
goheader:
values:
regexp:
AUTHOR: ^Copyright 2024 (The Kubernetes authors|Swisscom \(Schweiz\) AG)\.
template: |-
{{ AUTHOR }}
settings:
goheader:
values:
regexp:
AUTHOR: ^Copyright 2024 (The Kubernetes authors|Swisscom \(Schweiz\) AG)\.
template: |-
{{ AUTHOR }}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
revive:
confidence: 0.8
severity: error
enable-all-rules: false
rules:
- name: blank-imports
severity: error
disabled: false
- name: context-as-argument
severity: error
disabled: false
- name: dot-imports
severity: error
disabled: true
- name: error-return
severity: error
disabled: false
- name: error-naming
severity: error
disabled: false
- name: if-return
severity: error
disabled: false
- name: increment-decrement
severity: error
disabled: false
- name: var-declaration
severity: error
disabled: false
- name: package-comments
severity: error
disabled: false
- name: range
severity: error
disabled: false
- name: receiver-naming
severity: error
disabled: false
- name: time-naming
severity: error
disabled: false
- name: indent-error-flow
severity: error
disabled: false
- name: errorf
severity: error
disabled: false
- name: context-keys-type
severity: error
disabled: false
- name: error-strings
severity: error
disabled: false
staticcheck:
# removed: "IP", "HTTPS", "URL" from defaults
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"]
checks:
- all
- -QF1008
- -QF1003
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- ^zz_generated.*
- third_party$
- builtin$
- examples$
issues:
max-same-issues: 0
formatters:
enable:
- goimports
exclusions:
generated: lax
paths:
- ^zz_generated.*
- third_party$
- builtin$
- examples$