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
This commit is contained in:
Ludovic Fernandez 2024-05-08 00:52:26 +02:00 committed by GitHub
parent 2470471b2b
commit 4d29184998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 11 deletions

View File

@ -21,11 +21,11 @@ jobs:
run: git config --global --add safe.directory $GITHUB_WORKSPACE; git describe --dirty --always --tags run: git config --global --add safe.directory $GITHUB_WORKSPACE; git describe --dirty --always --tags
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v4 uses: golangci/golangci-lint-action@v6
with: with:
# TODO: revert to latest when this issue is resolved: https://github.com/golangci/golangci-lint/issues/4695 version: latest
version: v1.57.2
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
problem-matchers: true
args: --timeout 2m args: --timeout 2m
- name: Install goimports - name: Install goimports

View File

@ -1,6 +1,3 @@
run:
go: "1.20"
linters: linters:
enable: enable:
- asasalint - asasalint
@ -28,8 +25,9 @@ linters:
- unused - unused
- whitespace - whitespace
issues: linters-settings:
exclude-rules: gosec:
- linters: excludes:
- gosec - G501
text: "(G501|G401|G505):" - G401
- G505