Skip to content

Commit

Permalink
Merge pull request #1304 from saschagrunert/lint
Browse files Browse the repository at this point in the history
Update golangci-lint to v1.55.2
  • Loading branch information
k8s-ci-robot authored Dec 4, 2023
2 parents 53e28eb + 83fc34e commit 3194548
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 46 deletions.
150 changes: 110 additions & 40 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,69 @@ run:
linters:
disable-all: true
enable:
- asasalint
- bidichk
- containedctx
- decorder
- dupl
- dupword
- durationcheck
- errname
- execinquery
- forcetypeassert
- gocheckcompilerdirectives
- gochecksumtype
- gofmt
- goimports
- gosmopolitan
- govet
- grouper
- importas
- inamedparam
- ineffassign
- interfacebloat
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
- nilerr
- nosprintfhostport
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- sloglint
- staticcheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- typecheck
- unused
- usestdlibvars
- wastedassign
- zerologlint
# - asciicheck
# - bodyclose
# - contextcheck
# - cyclop
# - depguard
# - dogsled
# - errcheck
# - errchkjson
# - errorlint
# - exhaustive
# - exhaustivestruct
# - exhaustruct
# - exportloopref
# - forbidigo
# - funlen
# - gci
# - ginkgolinter
# - gochecknoglobals
# - gochecknoinits
# - gocognit
Expand All @@ -49,30 +79,32 @@ linters:
# - goerr113
# - gofumpt
# - goheader
# - golint
# - gomnd
# - gomoddirectives
# - gomodguard
# - goprintffuncname
# - gosec
# - gosimple
# - ifshort
# - ireturn
# - lll
# - nestif
# - nilnil
# - nlreturn
# - noctx
# - nolintlint
# - nonamedreturns
# - paralleltest
# - perfsprint
# - revive
# - rowserrcheck
# - scopelint
# - sqlclosecheck
# - stylecheck
# - testpackage
# - thelper
# - tparallel
# - unconvert
# - unparam
# - varnamelen
# - whitespace
# - wrapcheck
# - wsl
Expand All @@ -81,71 +113,109 @@ linters-settings:
checks: ["SA1019"]
gocritic:
enabled-checks:
# Diagnostic
- appendAssign
- appendCombine
- argOrder
- assignOp
- badCall
- badCond
- badLock
- badRegexp
- badSorting
- 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
- nilValReturn
- offBy1
- sloppyReassign
- weakCond
- octalLiteral

# Performance
- appendCombine
- equalFold
- hexLiteral
- httpNoBody
- hugeParam
- ifElseChain
- importShadow
- indexAlloc
- initClause
- mapKey
- methodExprCall
- nestingReduce
- newDeref
- nilValReturn
- octalLiteral
- offBy1
- paramTypeCombine
- preferDecodeRune
- preferFilepathJoin
- preferFprint
- preferStringWriter
- preferWriteByte
- ptrToRefParam
- rangeExprCopy
- rangeValCopy

# Style
- assignOp
- boolExprSimplify
- captLocal
- commentFormatting
- commentedOutImport
- defaultCaseOrder
- docStub
- elseif
- emptyFallthrough
- emptyStringTest
- hexLiteral
- ifElseChain
- methodExprCall
- redundantSprint
- regexpMust
- regexpPattern
- regexpSimplify
- returnAfterHttpError
- ruleguard
- singleCaseSwitch
- sliceClear
- sloppyLen
- sloppyReassign
- sloppyTestFuncName
- sloppyTypeAssert
- sortSlice
- sprintfQuotedString
- sqlQuery
- stringConcatSimplify
- stringXbytes
- stringsCompare
- switchTrue
- syncMapLoadAndDelete
- timeCmpSimplify
- timeExprSimplify
- todoCommentWithoutDetail
- tooManyResultsChecker
- truncateCmp
- typeAssertChain
- typeDefFirst
- typeSwitchVar
- typeUnparen
- uncheckedInlineErr
- underef
- unlabelStmt
- unlambda
- unnamedResult
- unnecessaryBlock
- unnecessaryDefer
- unslice
- valSwap
- weakCond
- whyNoLint
- wrapperFunc
- yodaStyleExpr

# Opinionated
- builtinShadow
- importShadow
- initClause
- nestingReduce
- paramTypeCombine
- ptrToRefParam
- typeUnparen
- unnamedResult
- unnecessaryBlock
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ install.lint: $(GOLANGCI_LINT)

$(GOLANGCI_LINT):
export \
VERSION=v1.52.2 \
VERSION=v1.55.2 \
URL=https://raw.githubusercontent.com/golangci/golangci-lint \
BINDIR=${BUILD_BIN_PATH} && \
curl -sfL $$URL/$$VERSION/install.sh | sh -s $$VERSION
Expand Down
2 changes: 1 addition & 1 deletion cmd/crictl/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var pullImageCommand = &cli.Command{
&cli.StringFlag{
Name: "pod-config",
Value: "",
Usage: "Use `pod-config.[json|yaml]` to override the the pull c",
Usage: "Use `pod-config.[json|yaml]` to override the pull c",
TakesFile: true,
},
&cli.StringSliceFlag{
Expand Down
4 changes: 2 additions & 2 deletions pkg/validate/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var _ = framework.KubeDescribe("Networking", func() {
})

It("runtime should support port mapping with only container port [Conformance]", func() {
By("create a PodSandbox with container port port mapping")
By("create a PodSandbox with container port mapping")
var podConfig *runtimeapi.PodSandboxConfig
portMappings := []*runtimeapi.PortMapping{
{
Expand All @@ -105,7 +105,7 @@ var _ = framework.KubeDescribe("Networking", func() {
})

It("runtime should support port mapping with host port and container port [Conformance]", func() {
By("create a PodSandbox with host port and container port port mapping")
By("create a PodSandbox with host port and container port mapping")
var podConfig *runtimeapi.PodSandboxConfig
portMappings := []*runtimeapi.PortMapping{
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/validate/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var _ = framework.KubeDescribe("Streaming", func() {
})

It("runtime should support portforward [Conformance]", func() {
By("create a PodSandbox with container port port mapping")
By("create a PodSandbox with container port mapping")
var podConfig *runtimeapi.PodSandboxConfig
portMappings := []*runtimeapi.PortMapping{
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/validate/streaming_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var _ = framework.KubeDescribe("Streaming", func() {
})

It("runtime should support portforward in host network", func() {
By("create a PodSandbox with container port port mapping in host network")
By("create a PodSandbox with container port mapping in host network")
var podConfig *runtimeapi.PodSandboxConfig
portMappings := []*runtimeapi.PortMapping{
{
Expand Down

0 comments on commit 3194548

Please sign in to comment.