From 089f1e23bda70985f24dc5975a44414b6ae7951c Mon Sep 17 00:00:00 2001 From: Sudeep Date: Wed, 30 Mar 2022 02:15:55 +0530 Subject: [PATCH] update pre-commit linter hook to run on entire repo - running on each file isn't as comprehensive as running against the entire repo. See this [issue](https://github.com/golangci/golangci-lint/issues/1574) --- .githooks/pre-commit | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 0efdcb17..d48900c5 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -15,13 +15,10 @@ fi PASS=true -for FILE in $STAGED_GO_FILES -do - golangci-lint run $FILE - if [[ $? == 1 ]]; then +golangci-lint run +if [[ $? == 1 ]]; then PASS=false - fi -done +fi if ! $PASS; then printf "COMMIT FAILED\n"