From 9521a924f0a45ebb56a9111290a58b8b331ee064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Mon, 12 Jun 2023 14:53:58 +0200 Subject: [PATCH] ci: fix linting issues A new version of golangci-lint updated depguard, which in turn started erroring because it was missing a config. Previously depguard did not do anything as we never configured a list of allowed/denied imports. In general, we already have gomodguard for linting imports. To avoid sudden breakages of our CI in the future, I pinned the exact version of golangci-lint to the current release. Upgrading this should hppen through a PR process (e.g. by renovate) so we can notice new linting failures and fix them before merging to main. --- .github/workflows/golangci-lint.yml | 4 ++-- .gitlab-ci.yml | 2 +- .golangci.yaml | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index ed6d26c8..d26edc44 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,8 +16,8 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: latest + # Required: the version of golangci-lint is required and must be specified without patch version + version: v1.53.2 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d5d5a94..2cbf73fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ variables: test:golangci-lint: stage: test - image: golangci/golangci-lint:latest + image: golangci/golangci-lint:v1.53.2 script: - golangci-lint run -v except: diff --git a/.golangci.yaml b/.golangci.yaml index ef87e033..6eb4c6cb 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -32,7 +32,6 @@ linters: disable-all: true enable: - bodyclose - - depguard - errcheck - errname - exhaustive