forked from quic-go/quic-go
add a pre-commit hook that check that files are properly gofumpt-ed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user