ci: bump to golangci-lint v2

Signed-off-by: Casey Callendrello <c1@caseyc.net>
This commit is contained in:
Casey Callendrello
2025-04-02 15:20:50 +02:00
parent c8096ae06f
commit a8d8d0488c
2 changed files with 59 additions and 41 deletions

View File

@@ -20,9 +20,9 @@ jobs:
- uses: ibiqlik/action-yamllint@v3 - uses: ibiqlik/action-yamllint@v3
with: with:
format: auto format: auto
- uses: golangci/golangci-lint-action@v6 - uses: golangci/golangci-lint-action@v7
with: with:
version: v1.61.0 version: v2.0.2
args: -v args: -v
verify-vendor: verify-vendor:
name: Verify vendor directory name: Verify vendor directory

View File

@@ -1,53 +1,71 @@
issues: version: "2"
exclude-rules: run:
- linters: modules-download-mode: vendor
- revive
text: "don't use ALL_CAPS in Go names; use CamelCase"
- linters:
- revive
text: " and that stutters;"
- path: '(.+)_test\.go'
text: "dot-imports: should not use dot imports"
linters: linters:
disable:
- errcheck
enable: enable:
- contextcheck - contextcheck
- durationcheck - durationcheck
- forbidigo - forbidigo
- gci
- ginkgolinter - ginkgolinter
- gocritic - gocritic
- gofumpt
- gosimple
- govet
- ineffassign
- misspell - misspell
- nonamedreturns - nonamedreturns
- predeclared - predeclared
- revive - revive
- staticcheck
- unconvert - unconvert
- unparam - unparam
- unused
- wastedassign - wastedassign
disable:
linters-settings: - errcheck
settings:
forbidigo:
forbid:
# Copied from https://github.com/moby/moby/pull/48407
- pattern: ^netlink\.(Handle\.)?(AddrList|BridgeVlanList|ChainList|ClassList|ConntrackTableList|ConntrackDeleteFilter$|ConntrackDeleteFilters|DevLinkGetDeviceList|DevLinkGetAllPortList|DevlinkGetDeviceParams|FilterList|FouList|GenlFamilyList|GTPPDPList|LinkByName|LinkByAlias|LinkList|LinkSubscribeWithOptions|NeighList$|NeighProxyList|NeighListExecute|NeighSubscribeWithOptions|LinkGetProtinfo|QdiscList|RdmaLinkList|RdmaLinkByName|RdmaLinkDel|RouteList|RouteListFilteredIter|RuleListFiltered$|RouteSubscribeWithOptions|RuleList$|RuleListFiltered|SocketGet|SocketDiagTCPInfo|SocketDiagTCP|SocketDiagUDPInfo|SocketDiagUDP|UnixSocketDiagInfo|UnixSocketDiag|VDPAGetDevConfigList|VDPAGetDevList|VDPAGetMGMTDevList|XfrmPolicyList|XfrmStateList)
pkg: ^github.com/vishvananda/netlink$
msg: Use internal netlinksafe package for EINTR handling.
analyze-types: true
staticcheck:
checks:
- all
- '-QF1008' # nested struct reference
- '-ST1005' # capitalized error strings
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- revive
- staticcheck
text: use ALL_CAPS in Go names; use CamelCase
- linters:
- revive
text: ' and that stutters;'
- path: (.+)_test\.go
text: 'dot-imports: should not use dot imports'
- path: (.+)_test\.go
text: "ginkgo-linter: wrong comparison assertion. Consider using (.+)BeZero(.+)"
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofumpt
settings:
gci: gci:
sections: sections:
- standard - standard
- default - default
- prefix(github.com/containernetworking) - prefix(github.com/containernetworking)
exclusions:
forbidigo: generated: lax
forbid: paths:
# Copied from https://github.com/moby/moby/pull/48407 - third_party$
- pkg: ^github.com/vishvananda/netlink$ - builtin$
p: ^netlink\.(Handle\.)?(AddrList|BridgeVlanList|ChainList|ClassList|ConntrackTableList|ConntrackDeleteFilter$|ConntrackDeleteFilters|DevLinkGetDeviceList|DevLinkGetAllPortList|DevlinkGetDeviceParams|FilterList|FouList|GenlFamilyList|GTPPDPList|LinkByName|LinkByAlias|LinkList|LinkSubscribeWithOptions|NeighList$|NeighProxyList|NeighListExecute|NeighSubscribeWithOptions|LinkGetProtinfo|QdiscList|RdmaLinkList|RdmaLinkByName|RdmaLinkDel|RouteList|RouteListFilteredIter|RuleListFiltered$|RouteSubscribeWithOptions|RuleList$|RuleListFiltered|SocketGet|SocketDiagTCPInfo|SocketDiagTCP|SocketDiagUDPInfo|SocketDiagUDP|UnixSocketDiagInfo|UnixSocketDiag|VDPAGetDevConfigList|VDPAGetDevList|VDPAGetMGMTDevList|XfrmPolicyList|XfrmStateList) - examples$
msg: Use internal netlinksafe package for EINTR handling.
analyze-types: true
run:
timeout: 5m
modules-download-mode: vendor