From cb30586afa57746742ba8165df9f0e39a8ff8425 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 29 Mar 2023 12:33:45 +0200 Subject: [PATCH] chore: pass argument to linter script (#15592) --- Makefile | 9 +++++++-- scripts/go-lint-all.sh | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8c9bbfd5031e..b610ae47cb97 100644 --- a/Makefile +++ b/Makefile @@ -379,9 +379,14 @@ golangci_version=v1.51.2 lint: @echo "--> Running linter" @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version) - @sh ./scripts/go-lint-all.sh + @sh ./scripts/go-lint-all.sh --timeout=15m -.PHONY: lint +lint-fix: + @echo "--> Running linter" + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version) + @sh ./scripts/go-lint-all.sh --fix + +.PHONY: lint lint-fix ############################################################################### ### Protobuf ### diff --git a/scripts/go-lint-all.sh b/scripts/go-lint-all.sh index 2f945db92592..4518046191ed 100644 --- a/scripts/go-lint-all.sh +++ b/scripts/go-lint-all.sh @@ -7,5 +7,5 @@ export pwd=$(pwd) for modfile in $(find . -name go.mod); do echo "linting $(dirname $modfile)" DIR=$(dirname $modfile) - (cd $DIR; golangci-lint run ./... --fix -c $pwd/.golangci.yml) + (cd $DIR; golangci-lint run ./... -c $pwd/.golangci.yml $@) done