From e1996819f85051fe2cc5a7796833d45cb8778a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Mon, 6 Jan 2025 16:30:27 +0300 Subject: [PATCH] consume golangci-linter 1.61.0 and update build submodule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- .github/workflows/ci.yml | 2 +- .github/workflows/uptest-trigger.yml | 2 +- .golangci.yml | 20 +++++++++++--------- Makefile | 9 ++++++++- build | 2 +- go.mod | 2 +- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c90c071..65fe5d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: {} env: - GO_VERSION: "1.21" + GO_VERSION: "1.23" jobs: detect-noop: diff --git a/.github/workflows/uptest-trigger.yml b/.github/workflows/uptest-trigger.yml index 292ab7e..ffcfab5 100644 --- a/.github/workflows/uptest-trigger.yml +++ b/.github/workflows/uptest-trigger.yml @@ -9,7 +9,7 @@ on: types: [created] env: - GO_VERSION: "1.21" + GO_VERSION: "1.23" jobs: debug: diff --git a/.golangci.yml b/.golangci.yml index 186369b..cb021c9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,14 +3,12 @@ # SPDX-License-Identifier: CC0-1.0 run: - deadline: 10m - - skip-files: - - "zz_\\..+\\.go$" + timeout: 10m output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: colored-line-number + formats: + - format: colored-line-number linters-settings: errcheck: @@ -25,7 +23,8 @@ linters-settings: # [deprecated] comma-separated list of pairs of the form pkg:regex # the regex is used to ignore names within pkg. (default "fmt:.*"). # see https://github.com/kisielk/errcheck#the-deprecated-method for details - ignore: fmt:.*,io/ioutil:^Read.* + exclude-files: + - fmt:.*,io/ioutil:^Read.* govet: # report about shadowed variables @@ -108,17 +107,18 @@ linters-settings: linters: enable: - - megacheck - govet - gocyclo - gocritic - - interfacer - goconst - goimports - gofmt # We enable this as well as goimports for its simplify mode. + - gosimple - prealloc - revive + - staticcheck - unconvert + - unused - misspell - nakedret @@ -129,6 +129,8 @@ linters: issues: + exclude-files: + - "zz_\\..+\\.go$" # Excluding configuration per-path and per-linter exclude-rules: # Exclude some linters from running on tests files. @@ -140,7 +142,7 @@ issues: - gosec - scopelint - unparam - + # Ease some gocritic warnings on test files. - path: _test\.go text: "(unnamedResult|exitAfterDefer)" diff --git a/Makefile b/Makefile index 9209afe..01871e4 100644 --- a/Makefile +++ b/Makefile @@ -321,6 +321,13 @@ go.cachedir: go.mod.cachedir: @go env GOMODCACHE +go.lint.analysiskey-interval: + @# cache is invalidated at least every 7 days + @echo -n golangci-lint.cache-$$(( $$(date +%s) / (7 * 86400) ))- + +go.lint.analysiskey: + @echo $$(make go.lint.analysiskey-interval)$$(sha1sum go.sum | cut -d' ' -f1) + DEP_CONSTRAINT ?= >= 0.0.0 ifeq (-,$(findstring -,$(VERSION))) DEP_CONSTRAINT = >= 0.0.0-0 @@ -368,7 +375,7 @@ load-pkg: $(UP) build.all @$(OK) Loaded the family providers into the Docker daemon: $(SUBPACKAGES) -.PHONY: cobertura reviewable submodules fallthrough go.mod.cachedir go.cachedir run crds.clean $(TERRAFORM_PROVIDER_SCHEMA) load-pkg +.PHONY: cobertura reviewable submodules fallthrough go.mod.cachedir go.cachedir go.lint.analysiskey-interval go.lint.analysiskey run crds.clean $(TERRAFORM_PROVIDER_SCHEMA) load-pkg build.init: kustomize-crds diff --git a/build b/build index 3cf6663..d315554 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 3cf6663fafcf22f5cb3e7b90cf21d981faa52230 +Subproject commit d3155548bfab68fc8bea64c5526642b7b565ae33 diff --git a/go.mod b/go.mod index 5dd5e62..9f26f09 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/upbound/provider-gcp-beta -go 1.21 +go 1.23 require ( dario.cat/mergo v1.0.0