diff --git a/.golangci.yml b/.golangci.yml index c0a50d4e..d1325f56 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,24 +5,33 @@ linters-settings: ignore-generated-header: true rules: - name: blank-imports + - name: constant-logical-expr - name: context-as-argument - name: context-keys-type + - name: defer - name: dot-imports + - name: duplicated-imports - name: empty-block - name: error-naming - name: error-return - name: error-strings - name: errorf - name: exported + - name: import-shadowing - name: increment-decrement - name: indent-error-flow - name: package-comments - name: range + - name: range-val-address + - name: range-val-in-closure - name: receiver-naming - name: redefines-builtin-id + - name: string-of-int - name: superfluous-else - name: time-naming + - name: unchecked-type-assertion - name: unexported-return + - name: unnecessary-stmt - name: unreachable-code - name: unused-parameter - name: var-declaration @@ -34,6 +43,7 @@ linters: - asasalint - asciicheck - bidichk + - containedctx - contextcheck - copyloopvar - dupword @@ -57,10 +67,13 @@ linters: - govet - ineffassign - intrange + - loggercheck - makezero + - mirror - misspell - musttag - nilerr + - nilnil - noctx - nolintlint - paralleltest diff --git a/Makefile b/Makefile index 4a5f55dc..0a919d32 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .DEFAULT_GOAL := build-goreleaser -# renovate: datasource=docker depName=golangci/golangci-lint +# renovate: datasource=github-tags depName=golangci/golangci-lint GOLANGCI_LINT_VERSION = v1.61.0 # renovate: datasource=docker depName=goreleaser/goreleaser GORELEASER_VERSION = v2.3.2 @@ -12,7 +12,7 @@ test: .PHONY: lint lint: - docker run --pull always --rm -v $(shell pwd):/nginx-asg-sync -w /nginx-asg-sync -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) golangci-lint --color always run + go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --fix nginx-asg-sync: @go version || (code=$$?; printf "\033[0;31mError\033[0m: unable to build locally, try using the parameter TARGET=container or TARGET=download\n"; exit $$code)