From 5c28be7ac324fd2d20adb9ed8c2456960ce43ad6 Mon Sep 17 00:00:00 2001 From: Ekaterina Kazakova Date: Mon, 11 Nov 2024 15:41:27 +0400 Subject: [PATCH] Use linter from makefile target in the build workflow By default, the linter uses the latest version (currently v1.62.0). In v1.62.0, a new max-public-structs linter was added. Significant changes are required in our codebase to enable this linter. --- .github/workflows/build_test.yml | 4 +--- Makefile | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 6f1844c7a..fe2fa81cd 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -53,9 +53,7 @@ jobs: go-version: ${{ env.GO_VERSION }} cache: false - name: Lint - uses: golangci/golangci-lint-action@v6 - with: - args: --timeout 10m0s + run: GOLANGCI_LINT_TIMEOUT=10m make lint - name: Verify all generated pieces are up-to-date run: make generate-all && git add -N . && git diff --exit-code - name: Unit tests diff --git a/Makefile b/Makefile index 6a9b44e8d..ea0f40c1b 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ test-e2e: cli-install .PHONY: lint lint: golangci-lint ## Run golangci-lint linter & yamllint - @$(GOLANGCI_LINT) run + @$(GOLANGCI_LINT) run --timeout=$(GOLANGCI_LINT_TIMEOUT) .PHONY: lint-fix lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes @@ -429,6 +429,7 @@ AWSCLI ?= $(LOCALBIN)/aws CONTROLLER_TOOLS_VERSION ?= v0.16.3 ENVTEST_VERSION ?= release-0.17 GOLANGCI_LINT_VERSION ?= v1.61.0 +GOLANGCI_LINT_TIMEOUT ?= 1m HELM_VERSION ?= v3.15.1 KIND_VERSION ?= v0.23.0 YQ_VERSION ?= v4.44.2