Skip to content

Commit

Permalink
Add recursive lint (#2204)
Browse files Browse the repository at this point in the history
* Add recursive lint

* Update make/scripts/lint.sh

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Trajan0x <trajan0x@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 4, 2024
1 parent c9d7497 commit 09c7390
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions make/repo.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions make/scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 09c7390

Please sign in to comment.