diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f91581fa69..e8afde6877 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -346,7 +346,7 @@ jobs: with: working-directory: ${{matrix.package}}/ # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.56.1 + version: v1.56.2 # see: https://github.com/golangci/golangci-lint/issues/2654 args: --timeout=60m env: diff --git a/make/repo.Makefile b/make/repo.Makefile index 82eb90ad48..67f889f9d0 100644 --- a/make/repo.Makefile +++ b/make/repo.Makefile @@ -30,6 +30,9 @@ tidy: ## Runs go mod tidy on all go.mod files in the repo go work sync $(GIT_ROOT)/make/scripts/tidy.sh +lint-go: ## Runs make lint in all go.mod files in the repo. + $(GIT_ROOT)/make/scripts/lint.sh + docker-clean: ## stops and removes all containers at once docker ps -aq | xargs docker stop | xargs docker rm docker network prune diff --git a/make/scripts/lint.sh b/make/scripts/lint.sh new file mode 100755 index 0000000000..ce08255ac4 --- /dev/null +++ b/make/scripts/lint.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e +find . -name go.mod -print0 | while IFS= read -r -d '' f; do + echo "linting $(dirname "$f")" + (cd "$(dirname "$f")" || exit; go mod tidy) +done