diff --git a/.golangci.yml b/.golangci.yml index e464d9c98..5ac70cf62 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,15 +1,40 @@ +version: "2" + run: + modules-download-mode: vendor tests: false - timeout: 10m -linters: - disable-all: true + +formatters: enable: - - misspell - gofmt - goimports + +linters: + default: none + enable: + - govet - ineffassign + - misspell - revive - unconvert - unused - - govet + exclusions: + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - revive + text: "(unused-parameter|redefines-builtin-id):" + # Log a warning if an exclusion rule is unused. + # Default: false + warn-unused: true + +issues: + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. + max-issues-per-linter: 0 + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. + max-same-issues: 0 diff --git a/Dockerfile b/Dockerfile index cee69366d..1f39e6f7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG GO_VERSION=1.18.9 ARG PROTOC_VERSION=3.11.4 -ARG GOLANGCI_LINT_VERSION=v1.50.1 +ARG GOLANGCI_LINT_VERSION=v2.1.6 ARG DEBIAN_FRONTEND=noninteractive FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS gobase diff --git a/direct.mk b/direct.mk index b21b85246..4e0392f12 100644 --- a/direct.mk +++ b/direct.mk @@ -41,8 +41,8 @@ version/version.go: .PHONY: setup setup: ## install dependencies @echo "🐳 $@" - # install golangci-lint version v1.50.1 to ./bin/golangci-lint - @curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/v1.50.1/install.sh | sh -s v1.50.1 + # install golangci-lint version v2.1.6 to ./bin/golangci-lint + @curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s v2.1.6 @(cd tools ; GO111MODULE=on go install github.com/containerd/protobuild) .PHONY: generate