build: reactivate golangci-lint (#10118)

With DeepSource becoming (imho) less and less useful, let's get this one
back on track. It will likely require adjusting over time.
This commit is contained in:
Jakob Borg
2025-05-20 14:03:43 +02:00
committed by GitHub
parent fa404d5a0d
commit 9a3493c2f4
2 changed files with 59 additions and 11 deletions

View File

@@ -127,6 +127,7 @@ jobs:
- package-debian
- package-windows
- govulncheck
- golangci
steps:
- uses: actions/checkout@v4
@@ -1020,3 +1021,22 @@ jobs:
go run build.go assets
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
golangci:
runs-on: ubuntu-latest
name: Run golangci-lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
check-latest: true
- name: ensure asset generation
run: go run build.go assets
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
only-new-issues: true

View File

@@ -1,39 +1,67 @@
version: "2"
linters:
enable-all: true
default: all
disable:
- cyclop
- depguard
- exhaustive
- exhaustruct
- forbidigo
- funlen
- gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocyclo
- godox
- gofmt
- goimports
- gomoddirectives
- inamedparam
- interfacebloat
- ireturn
- lll
- maintidx
- mnd
- musttag
- nestif
- nlreturn
- nonamedreturns
- paralleltest
- prealloc
- predeclared
- protogetter
- scopelint
- recvcheck
- revive
- tagalign
- tagliatelle
- testpackage
- usetesting # go 1.24
- varnamelen
- whitespace
- wrapcheck
- wsl
issues:
exclude-dirs:
- internal/gen
- cmd/dev
- repos
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- internal/gen
- cmd/dev
- repos
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofumpt
exclusions:
generated: lax
paths:
- internal/gen
- cmd/dev
- repos
- third_party$
- builtin$
- examples$