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
gci: settings:
sections: forbidigo:
- standard forbid:
- default # Copied from https://github.com/moby/moby/pull/48407
- prefix(github.com/containernetworking) - 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$
forbidigo: msg: Use internal netlinksafe package for EINTR handling.
forbid: analyze-types: true
# Copied from https://github.com/moby/moby/pull/48407 staticcheck:
- pkg: ^github.com/vishvananda/netlink$ checks:
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) - all
msg: Use internal netlinksafe package for EINTR handling. - '-QF1008' # nested struct reference
analyze-types: true - '-ST1005' # capitalized error strings
exclusions:
run: generated: lax
timeout: 5m presets:
modules-download-mode: vendor - 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:
sections:
- standard
- default
- prefix(github.com/containernetworking)
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$