Skip to content

Commit

Permalink
Merge pull request #209 from saschagrunert/golangci
Browse files Browse the repository at this point in the history
Update golangci-lint and config
  • Loading branch information
openshift-merge-bot[bot] authored Jul 8, 2024
2 parents 0692f4e + 963a305 commit dc389f2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 114 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@ updates:
labels:
- "release-note-none"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "release-note-none"
groups:
actions:
update-types:
- "major"
- "minor"
- "patch"
120 changes: 9 additions & 111 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
run:
concurrency: 6
deadline: 10m
timeout: 10m
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- decorder
- dogsled
- dupl
Expand All @@ -20,9 +22,9 @@ linters:
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- fatcontext
- forbidigo
- forcetypeassert
- gci
Expand Down Expand Up @@ -51,7 +53,8 @@ linters:
- inamedparam
- ineffassign
- interfacebloat
- logrlint
- intrange
- loggercheck
- maintidx
- makezero
- mirror
Expand Down Expand Up @@ -94,14 +97,14 @@ linters:
- zerologlint
# - cyclop
# - depguard
# - err113
# - exhaustruct
# - funlen
# - gocognit
# - goerr113
# - gomnd
# - gosec
# - ireturn
# - lll
# - mnd
# - nlreturn
# - nonamedreturns
# - tagliatelle
Expand All @@ -117,109 +120,4 @@ linters-settings:
nestif:
min-complexity: 10
gocritic:
enabled-checks:
- appendAssign
- appendCombine
- argOrder
- assignOp
- badCall
- badCond
- badLock
- badRegexp
- badSorting
- badSyncOnceFunc
- boolExprSimplify
- builtinShadow
- builtinShadowDecl
- captLocal
- caseOrder
- codegenComment
- commentFormatting
- commentedOutCode
- commentedOutImport
- defaultCaseOrder
- deferInLoop
- deferUnlambda
- deprecatedComment
- docStub
- dupArg
- dupBranchBody
- dupCase
- dupImport
- dupSubExpr
- dynamicFmtString
- elseif
- emptyDecl
- emptyFallthrough
- emptyStringTest
- equalFold
- evalOrder
- exitAfterDefer
- exposedSyncMutex
- externalErrorReassign
- filepathJoin
- flagDeref
- flagName
- hexLiteral
- httpNoBody
- hugeParam
- ifElseChain
- importShadow
- indexAlloc
- initClause
- mapKey
- methodExprCall
- nestingReduce
- newDeref
- nilValReturn
- octalLiteral
- offBy1
- paramTypeCombine
- preferDecodeRune
- preferFilepathJoin
- preferFprint
- preferStringWriter
- preferWriteByte
- ptrToRefParam
- rangeExprCopy
- rangeValCopy
- redundantSprint
- regexpMust
- regexpPattern
- regexpSimplify
- returnAfterHttpError
- ruleguard
- singleCaseSwitch
- sliceClear
- sloppyLen
- sloppyReassign
- sloppyTypeAssert
- sortSlice
- sprintfQuotedString
- sqlQuery
- stringConcatSimplify
- stringXbytes
- stringsCompare
- switchTrue
- syncMapLoadAndDelete
- timeExprSimplify
- todoCommentWithoutDetail
- tooManyResultsChecker
- truncateCmp
- typeAssertChain
- typeDefFirst
- typeSwitchVar
- typeUnparen
- uncheckedInlineErr
- underef
- unlabelStmt
- unlambda
- unnamedResult
- unnecessaryBlock
- unnecessaryDefer
- unslice
- valSwap
- weakCond
- whyNoLint
- wrapperFunc
- yodaStyleExpr
enable-all: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BUILD_INFO := $(shell date +%s)

BUILD_PATH := $(shell pwd)/build
GOLANGCI_LINT := ${BUILD_PATH}/golangci-lint
GOLANGCI_LINT_VERSION := v1.56.2
GOLANGCI_LINT_VERSION := v1.59.1

# If GOPATH not specified, use one in the local directory
ifeq ($(GOPATH),)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cri-o/ocicni

go 1.20
go 1.22

require (
github.com/containernetworking/cni v1.2.2
Expand Down
2 changes: 1 addition & 1 deletion pkg/ocicni/ocicni.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ func (plugin *cniNetworkPlugin) fillPodNetworks(podNetwork *PodNetwork) error {
netLoop:
for i, network := range podNetwork.Networks {
if network.Ifname == "" {
for j := 0; j < 10000; j++ {
for j := range 10000 {
candidate := fmt.Sprintf("eth%d", j)
if !allIfNames[candidate] {
allIfNames[candidate] = true
Expand Down

0 comments on commit dc389f2

Please sign in to comment.