From b78fa41e4273fface7403b7d980ce0875efeba12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 24 Mar 2025 19:28:45 +0100 Subject: [PATCH 1/3] Satisfy staticcheck MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > QF1008: could remove embedded field "dockerImageOptions" from selector (staticcheck) Should not change behavior. Signed-off-by: Miloslav Trmač --- cmd/skopeo/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/skopeo/utils.go b/cmd/skopeo/utils.go index 5c9f397b..3008443b 100644 --- a/cmd/skopeo/utils.go +++ b/cmd/skopeo/utils.go @@ -200,8 +200,8 @@ func (opts *imageOptions) newSystemContext() (*types.SystemContext, error) { ctx.AuthFilePath = opts.shared.authFilePath ctx.DockerDaemonHost = opts.dockerDaemonHost ctx.DockerDaemonCertPath = opts.dockerCertPath - if opts.dockerImageOptions.authFilePath.Present() { - ctx.AuthFilePath = opts.dockerImageOptions.authFilePath.Value() + if opts.authFilePath.Present() { + ctx.AuthFilePath = opts.authFilePath.Value() } if opts.deprecatedTLSVerify != nil && opts.deprecatedTLSVerify.tlsVerify.Present() { // If both this deprecated option and a non-deprecated option is present, we use the latter value. From 11fc49b491bfc45a772f48315e711b70338ebb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 24 Mar 2025 19:36:01 +0100 Subject: [PATCH 2/3] Rely on golangci-lint exit code instead of expecting empty output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- hack/validate-lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/validate-lint.sh b/hack/validate-lint.sh index d3dc7d11..e1e339b2 100755 --- a/hack/validate-lint.sh +++ b/hack/validate-lint.sh @@ -2,7 +2,7 @@ errors=$($GOBIN/golangci-lint run --build-tags "${BUILDTAGS}" 2>&1) -if [ -z "$errors" ]; then +if [ "$?" -eq 0 ]; then echo 'Congratulations! All Go source files have been linted.' else { From ba2f8b7ace466d852c5a06db0116b0f7f5eac49a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 17:16:53 +0000 Subject: [PATCH 3/3] chore(deps): update dependency golangci/golangci-lint to v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: Miloslav Trmač --- .golangci.yml | 14 +++++++++++--- Makefile | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8d05e483..ebbd1747 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,11 @@ ---- -run: - timeout: 5m +version: "2" +linters: + settings: + staticcheck: + checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-ST1005"] # golangci-lint's default, we add -ST1005 + exclusions: + presets: + - comments + - common-false-positives + - legacy + - std-error-handling diff --git a/Makefile b/Makefile index 3cf077f3..80d639c9 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ GOARCH ?= $(shell go env GOARCH) # N/B: This value is managed by Renovate, manual changes are # possible, as long as they don't disturb the formatting # (i.e. DO NOT ADD A 'v' prefix!) -GOLANGCI_LINT_VERSION := 1.64.8 +GOLANGCI_LINT_VERSION := 2.0.0 ifeq ($(GOBIN),) GOBIN := $(GOPATH)/bin