From 53571b0a26f81be5c270193d4e20f3cae903fc7a Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 19 Apr 2023 15:05:51 +0200 Subject: [PATCH] githooks: add check that go.mod in integrationtests/gomodvendor is tidy (#3750) --- .githooks/pre-commit | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 86b464c51..142c1e338 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -13,6 +13,14 @@ for f in $(git diff --cached --name-only); do fi done +pushd ./integrationtests/gomodvendor > /dev/null +go mod tidy +if [[ -n $(git diff --name-only -- "go.mod" "go.sum") ]]; then + echo "go.mod / go.sum in integrationtests/gomodvendor not tidied" + errored=true +fi +popd > /dev/null + # Check that all Go files are properly gofumpt-ed. output=$(gofumpt -d $(git diff --cached --name-only -- '*.go')) if [ -n "$output" ]; then