Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 77 additions & 74 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: "2"
linters:
disable-all: true
# One can't use disable and disable-all. disable-all is preferred to avoid lint failing when golangci gets updated and linters are added.
Expand Down Expand Up @@ -42,77 +43,79 @@ linters:
#- godot # Allow comments not ending with dot.
#- goerr113 # We don't need stack traces in our errors.
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- decorder
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- execinquery
- exportloopref
- ginkgolinter
- gocheckcompilerdirectives
- gochecksumtype
- goconst
- gocritic
- gocyclo
- gofmt
- gofumpt
- goheader
- goimports
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nestif
- nilerr
- nilnil
- nolintlint
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- staticcheck
- stylecheck
- tagalign
- tenv
- testableexamples
- testifylint
- thelper
- tparallel
- typecheck
- unconvert
- unused
- usestdlibvars
- wastedassign
- whitespace
issues:
max-same-issues: 0
max-issues-per-linter: 0
linters-settings:
gosec:
excludes:
- G301 # Poor file permissions used when creating a directory.
- G302 # Poor file permissions used with chmod.
- G306 # Poor file permissions used when writing to a new file.
- G601 # Taking address of loop variable - not relevant anymore.
- G602 # Should reports out of bound access but is broken.
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- decorder
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- ginkgolinter
- gocheckcompilerdirectives
- gochecksumtype
- goconst
- gocritic
- gocyclo
- goheader
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nestif
- nilerr
- nilnil
- nolintlint
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- staticcheck
- stylecheck
- tagalign
- tenv
- testableexamples
- testifylint
- thelper
- tparallel
- typecheck
- unconvert
- unused
- usestdlibvars
- wastedassign
- whitespace
exclusions:
generated: lax
max-same-issues: 0
max-issues-per-linter: 0
settings:
gosec:
excludes:
- G301 # Poor file permissions used when creating a directory.
- G302 # Poor file permissions used with chmod.
- G306 # Poor file permissions used when writing to a new file.
- G601 # Taking address of loop variable - not relevant anymore.
- G602 # Should reports out of bound access but is broken.
formatters:
enable:
- gofmt
- gofumpt
- goimports
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ OS := $(shell go env GOOS | sed 's/[a-z]/\U&/')
ARCH := $(shell go env GOARCH)

GORELEASER_VERSION="v1.15.0"
GOLANGCI_LINT_VERSION="v1.55.0"
GOLANGCI_LINT_VERSION="v2.0.2"

.PHONY: download-goreleaser
download-goreleaser:
GOBIN=${BIN_DIR} go install github.com/goreleaser/goreleaser@${GORELEASER_VERSION}

.PHONY: download-golangci-lint
download-golangci-lint:
GOBIN=${BIN_DIR} go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
GOBIN=${BIN_DIR} go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}

SINGLE_TARGET ?= false

Expand Down