From ba894e8bb3582171bc74122a0d32d98953259bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Dom=C3=ADnguez?= Date: Wed, 22 Jan 2025 00:33:08 +0100 Subject: [PATCH] Add renovate to go linters (#4558) --- Dockerfile | 9 ++++++--- flavors/cupcake/Dockerfile | 9 ++++++--- flavors/go/Dockerfile | 9 ++++++--- linters/go_golangci_lint/Dockerfile | 5 +++-- linters/go_revive/Dockerfile | 6 +++--- megalinter/descriptors/go.megalinter-descriptor.yml | 11 ++++++++--- 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 870d5175afa..5c21d602ef7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,8 @@ ARG BASH_SHFMT_VERSION=v3.10.0-alpine ARG DOCKERFILE_HADOLINT_VERSION=v2.12.0-alpine # renovate: datasource=docker depName=mstruebing/editorconfig-checker ARG EDITORCONFIG_EDITORCONFIG_CHECKER_VERSION=v3.1.2 +# renovate: datasource=github-tags depName=mgechev/revive +ARG GO_REVIVE_VERSION=v1.5.1 # renovate: datasource=docker depName=ghcr.io/yannh/kubeconform ARG KUBERNETES_KUBECONFORM_VERSION=v0.6.7-alpine # renovate: datasource=docker depName=yoheimuta/protolint @@ -59,8 +61,7 @@ FROM golang:1-alpine AS revive ## The golang image used as a builder is a temporary workaround (https://github.com/mgechev/revive/issues/787) ## for the released revive binaries not returning version numbers (devel). ## The install command should then be what is commented in the go.megalinter-descriptor.yml -# renovate: datasource=github-tags depName=mgechev/revive -ARG GO_REVIVE_VERSION=v1.5.1 +ARG GO_REVIVE_VERSION RUN GOBIN=/usr/bin go install github.com/mgechev/revive@$GO_REVIVE_VERSION FROM ghcr.io/yannh/kubeconform:${KUBERNETES_KUBECONFORM_VERSION} AS kubeconform FROM ghcr.io/assignuser/chktex-alpine:latest AS chktex @@ -134,6 +135,8 @@ ARG CSHARP_CSHARPIER_VERSION=0.30.6 ARG CSHARP_ROSLYNATOR_VERSION=0.9.3 # renovate: datasource=dart-version depName=dart ARG DART_VERSION='3.6.1' +# renovate: datasource=github-tags depName=golangci/golangci-lint +ARG GO_GOLANGCI_LINT_VERSION=1.63.4 # renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ ARG PMD_VERSION=7.9.0 @@ -654,7 +657,7 @@ ENV PATH="/usr/lib/dart/bin:${PATH}" RUN wget -q -O - https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s \ # # golangci-lint installation - && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \ + && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s "v${GO_GOLANGCI_LINT_VERSION}" \ && golangci-lint --version # diff --git a/flavors/cupcake/Dockerfile b/flavors/cupcake/Dockerfile index 9de7d4c252f..7c46f185bd9 100644 --- a/flavors/cupcake/Dockerfile +++ b/flavors/cupcake/Dockerfile @@ -22,6 +22,8 @@ ARG BASH_SHFMT_VERSION=v3.10.0-alpine ARG DOCKERFILE_HADOLINT_VERSION=v2.12.0-alpine # renovate: datasource=docker depName=mstruebing/editorconfig-checker ARG EDITORCONFIG_EDITORCONFIG_CHECKER_VERSION=v3.1.2 +# renovate: datasource=github-tags depName=mgechev/revive +ARG GO_REVIVE_VERSION=v1.5.1 # renovate: datasource=docker depName=ghcr.io/yannh/kubeconform ARG KUBERNETES_KUBECONFORM_VERSION=v0.6.7-alpine # renovate: datasource=docker depName=zricethezav/gitleaks @@ -56,8 +58,7 @@ FROM golang:1-alpine AS revive ## The golang image used as a builder is a temporary workaround (https://github.com/mgechev/revive/issues/787) ## for the released revive binaries not returning version numbers (devel). ## The install command should then be what is commented in the go.megalinter-descriptor.yml -# renovate: datasource=github-tags depName=mgechev/revive -ARG GO_REVIVE_VERSION=v1.5.1 +ARG GO_REVIVE_VERSION RUN GOBIN=/usr/bin go install github.com/mgechev/revive@$GO_REVIVE_VERSION FROM ghcr.io/yannh/kubeconform:${KUBERNETES_KUBECONFORM_VERSION} AS kubeconform FROM zricethezav/gitleaks:${REPOSITORY_GITLEAKS_VERSION} AS gitleaks @@ -103,6 +104,8 @@ ARG CLJ_KONDO_VERSION=2025.01.16 # renovate: datasource=github-tags depName=greglook/cljstyle ARG CLJ_STYLE_VERSION=0.17.642 +# renovate: datasource=github-tags depName=golangci/golangci-lint +ARG GO_GOLANGCI_LINT_VERSION=1.63.4 # renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ ARG PMD_VERSION=7.9.0 @@ -451,7 +454,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil && wget -q -O - https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s \ # # golangci-lint installation - && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \ + && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s "v${GO_GOLANGCI_LINT_VERSION}" \ && golangci-lint --version # diff --git a/flavors/go/Dockerfile b/flavors/go/Dockerfile index 1d229f7eb48..b94b18bef20 100644 --- a/flavors/go/Dockerfile +++ b/flavors/go/Dockerfile @@ -22,6 +22,8 @@ ARG BASH_SHFMT_VERSION=v3.10.0-alpine ARG DOCKERFILE_HADOLINT_VERSION=v2.12.0-alpine # renovate: datasource=docker depName=mstruebing/editorconfig-checker ARG EDITORCONFIG_EDITORCONFIG_CHECKER_VERSION=v3.1.2 +# renovate: datasource=github-tags depName=mgechev/revive +ARG GO_REVIVE_VERSION=v1.5.1 # renovate: datasource=docker depName=ghcr.io/yannh/kubeconform ARG KUBERNETES_KUBECONFORM_VERSION=v0.6.7-alpine # renovate: datasource=docker depName=yoheimuta/protolint @@ -52,8 +54,7 @@ FROM golang:1-alpine AS revive ## The golang image used as a builder is a temporary workaround (https://github.com/mgechev/revive/issues/787) ## for the released revive binaries not returning version numbers (devel). ## The install command should then be what is commented in the go.megalinter-descriptor.yml -# renovate: datasource=github-tags depName=mgechev/revive -ARG GO_REVIVE_VERSION=v1.5.1 +ARG GO_REVIVE_VERSION RUN GOBIN=/usr/bin go install github.com/mgechev/revive@$GO_REVIVE_VERSION FROM ghcr.io/yannh/kubeconform:${KUBERNETES_KUBECONFORM_VERSION} AS kubeconform FROM yoheimuta/protolint:${PROTOBUF_PROTOLINT_VERSION} AS protolint @@ -90,6 +91,8 @@ FROM python:3.12.8-alpine3.21 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START +# renovate: datasource=github-tags depName=golangci/golangci-lint +ARG GO_GOLANGCI_LINT_VERSION=1.63.4 # renovate: datasource=github-tags depName=pinterest/ktlint ARG KTLINT_VERSION=1.5.0 @@ -304,7 +307,7 @@ RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: Fil && wget -q -O - https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s \ # # golangci-lint installation - && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \ + && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s "v${GO_GOLANGCI_LINT_VERSION}" \ && golangci-lint --version # diff --git a/linters/go_golangci_lint/Dockerfile b/linters/go_golangci_lint/Dockerfile index 6afeb24e16f..712e9c02dd4 100644 --- a/linters/go_golangci_lint/Dockerfile +++ b/linters/go_golangci_lint/Dockerfile @@ -48,7 +48,8 @@ FROM python:3.12.8-alpine3.21 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START - +# renovate: datasource=github-tags depName=golangci/golangci-lint +ARG GO_GOLANGCI_LINT_VERSION=1.63.4 #ARG__END #################### @@ -147,7 +148,7 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ ############################################################################################# #OTHER__START # golangci-lint installation -RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \ +RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s "v${GO_GOLANGCI_LINT_VERSION}" \ && golangci-lint --version # diff --git a/linters/go_revive/Dockerfile b/linters/go_revive/Dockerfile index f61a183d8dd..a6c5c17a8d0 100644 --- a/linters/go_revive/Dockerfile +++ b/linters/go_revive/Dockerfile @@ -11,7 +11,8 @@ ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARGTOP__START - +# renovate: datasource=github-tags depName=mgechev/revive +ARG GO_REVIVE_VERSION=v1.5.1 #ARGTOP__END ############################################################################################# @@ -22,8 +23,7 @@ FROM golang:1-alpine AS revive ## The golang image used as a builder is a temporary workaround (https://github.com/mgechev/revive/issues/787) ## for the released revive binaries not returning version numbers (devel). ## The install command should then be what is commented in the go.megalinter-descriptor.yml -# renovate: datasource=github-tags depName=mgechev/revive -ARG GO_REVIVE_VERSION=v1.5.1 +ARG GO_REVIVE_VERSION RUN GOBIN=/usr/bin go install github.com/mgechev/revive@$GO_REVIVE_VERSION #FROM__END diff --git a/megalinter/descriptors/go.megalinter-descriptor.yml b/megalinter/descriptors/go.megalinter-descriptor.yml index 3c5049abe91..cfe47304c29 100644 --- a/megalinter/descriptors/go.megalinter-descriptor.yml +++ b/megalinter/descriptors/go.megalinter-descriptor.yml @@ -30,8 +30,11 @@ linters: - "golangci-lint run -c .golangci.yml myfile.go" install: dockerfile: + - |- + # renovate: datasource=github-tags depName=golangci/golangci-lint + ARG GO_GOLANGCI_LINT_VERSION=1.63.4 - | - RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \ + RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s "v${GO_GOLANGCI_LINT_VERSION}" \ && golangci-lint --version ide: atom: @@ -81,13 +84,15 @@ linters: ## Until "FROM ghcr.io/mgechev/revive:1.2.5 AS revive" is available, use # - FROM ghcr.io/mgechev/revive:1.2.5 AS revive # - COPY --link --from=revive /usr/bin/revive /usr/bin/revive + - |- + # renovate: datasource=github-tags depName=mgechev/revive + ARG GO_REVIVE_VERSION=v1.5.1 - |- FROM golang:1-alpine AS revive ## The golang image used as a builder is a temporary workaround (https://github.com/mgechev/revive/issues/787) ## for the released revive binaries not returning version numbers (devel). ## The install command should then be what is commented in the go.megalinter-descriptor.yml - # renovate: datasource=github-tags depName=mgechev/revive - ARG GO_REVIVE_VERSION=v1.5.1 + ARG GO_REVIVE_VERSION RUN GOBIN=/usr/bin go install github.com/mgechev/revive@$GO_REVIVE_VERSION - COPY --link --from=revive /usr/bin/revive /usr/bin/revive ide: