Skip to content

Commit

Permalink
Bump go, k8s deps and linter versions, and some fixes (#596)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcin Owsiany <porridge@redhat.com>
  • Loading branch information
porridge authored Dec 18, 2024
1 parent 87884cf commit db58f80
Show file tree
Hide file tree
Showing 34 changed files with 217 additions and 181 deletions.
95 changes: 80 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,113 @@ linters:
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- decorder
- dogsled
- durationcheck
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- exportloopref
- exhaustive
- fatcontext
- forcetypeassert
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- gochecksumtype
- goconst
- gocritic
- gocyclo
- gofmt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosimple
- gosmopolitan
- govet
- grouper
- iface
- importas
- ineffassign
- interfacebloat
- lll
- loggercheck
- makezero
- mirror
- misspell
- nakedret
- nilerr
- noctx
- nolintlint
- nosprintfhostport
- predeclared
- promlinter
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- typecheck
- tagliatelle
- testableexamples
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
run:
go: '1.17'
skip-dirs:
- hack
- dist
- keps
- kind-*
- zerologlint
disable:
# These linters are disabled ONLY because fixing/investigating their complaints initially was too overwhelming.
# We SHOULD try and evaluate each of them eventually and either fix their reports
# or comment here on why we decided to not listen to them.
- cyclop
- depguard
- err113
- errorlint
- exhaustruct
- forbidigo
- funlen
- gci
- gocognit
- godot
- godox
- gofumpt
- gosec
- inamedparam
- intrange
- ireturn
- gochecknoglobals
- maintidx
- mnd
- musttag
- nestif
- nilnil
- nlreturn
- nonamedreturns
- paralleltest
- perfsprint
- prealloc
- tagalign
- tenv
- testifylint
- testpackage
- thelper
- varnamelen
- wrapcheck
- wsl

linters-settings:
errcheck:
Expand All @@ -60,8 +125,8 @@ linters-settings:
# Don't use 'github.com/kudobuilder/kuttl', it'll result in unreliable output!
local-prefixes: github.com/kudobuilder
issues:
# ignore errchecks for test files
exclude-rules:
- path: _test\.go
linters:
- errcheck
exclude-dirs:
- hack
- dist
- keps
- kind-*
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ BUILD_DATE_PATH := github.com/kudobuilder/kuttl/pkg/version.buildDate
DATE_FMT := "%Y-%m-%dT%H:%M:%SZ"
BUILD_DATE := $(shell date -u -d "@$SOURCE_DATE_EPOCH" "+${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "+${DATE_FMT}" 2>/dev/null || date -u "+${DATE_FMT}")
LDFLAGS := -X ${GIT_VERSION_PATH}=${GIT_VERSION} -X ${GIT_COMMIT_PATH}=${GIT_COMMIT} -X ${BUILD_DATE_PATH}=${BUILD_DATE}
GOLANGCI_LINT_VER = "1.54.2"

# Please update the list of linters in .golagci.yml when bumping the version.
GOLANGCI_LINT_VER = "1.62.2"
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION ?= 1.25.0

Expand All @@ -33,7 +35,7 @@ help: ## Show this help screen

.PHONY: lint
lint: ## Run golangci-lint
ifneq (${GOLANGCI_LINT_VER}, "$(shell ./bin/golangci-lint version --format short 2>&1)")
ifneq (${GOLANGCI_LINT_VER}, "$(shell test -x ./bin/golangci-lint && ./bin/golangci-lint version --format short 2>&1)")
@echo "golangci-lint missing or not version '${GOLANGCI_LINT_VER}', downloading..."
curl -sSfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${GOLANGCI_LINT_VER}/install.sh" | sh -s -- -b ./bin "v${GOLANGCI_LINT_VER}"
endif
Expand Down
34 changes: 17 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kudobuilder/kuttl

go 1.22.7
go 1.23.0

require (
github.com/Masterminds/semver/v3 v3.3.1
Expand All @@ -14,17 +14,18 @@ require (
github.com/stretchr/testify v1.10.0
github.com/thoas/go-funk v0.9.3
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.31.3
k8s.io/apiextensions-apiserver v0.31.3
k8s.io/apimachinery v0.31.3
k8s.io/client-go v0.31.3
k8s.io/code-generator v0.31.3
k8s.io/api v0.32.0
k8s.io/apiextensions-apiserver v0.32.0
k8s.io/apimachinery v0.32.0
k8s.io/client-go v0.32.0
k8s.io/code-generator v0.32.0
sigs.k8s.io/controller-runtime v0.19.3
sigs.k8s.io/controller-tools v0.16.5
sigs.k8s.io/kind v0.25.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/alessio/shellescape v1.4.2 // indirect
Expand All @@ -40,9 +41,9 @@ require (
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
Expand All @@ -51,7 +52,6 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -76,23 +76,23 @@ require (
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/time v0.7.0 // indirect
golang.org/x/tools v0.26.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.3.0 // indirect
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit db58f80

Please sign in to comment.