diff --git a/.githooks/pre-commit b/.githooks/pre-commit index a19cc2371..4a9aedc1c 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -13,6 +13,14 @@ for f in $(git diff --cached --name-only); do fi done +# Check that all files are properly gofumpt-ed. +output=$(gofumpt -d $(git diff --cached --name-only)) +if [ -n "$output" ]; then + echo "Found files that are not properly gofumpt-ed." + echo "$output" + errored=true +fi + if [ "$errored" = true ]; then exit 1 fi