From 4d29184998c91b1fa3b73b9b2e744690bf060820 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Wed, 8 May 2024 00:52:26 +0200 Subject: [PATCH] Improves golangci-lint configuration and workflow (#3004) * chore: the default Go version is based on the go.mod * chore: use linter configuration instead of exclude-rules * chore: update workflow --- .github/workflows/pipeline.yml | 6 +++--- .golangci.yml | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 75ebc4c3..07ffece5 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -21,11 +21,11 @@ jobs: run: git config --global --add safe.directory $GITHUB_WORKSPACE; git describe --dirty --always --tags - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v6 with: - # TODO: revert to latest when this issue is resolved: https://github.com/golangci/golangci-lint/issues/4695 - version: v1.57.2 + version: latest github-token: ${{ secrets.GITHUB_TOKEN }} + problem-matchers: true args: --timeout 2m - name: Install goimports diff --git a/.golangci.yml b/.golangci.yml index f9a2caf8..6f7f22d3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,3 @@ -run: - go: "1.20" - linters: enable: - asasalint @@ -28,8 +25,9 @@ linters: - unused - whitespace -issues: - exclude-rules: - - linters: - - gosec - text: "(G501|G401|G505):" +linters-settings: + gosec: + excludes: + - G501 + - G401 + - G505