pgweb/script/check_formatting.sh

15 lines
296 B
Bash
Raw Normal View History

2018-03-16 19:59:58 -05:00
#!/bin/bash
2018-03-16 20:15:06 -05:00
# Run the fmt on bindata so it does not trigger failure
go fmt ./pkg/data/bindata.go > /dev/null
# Get list of offending files
2018-03-16 20:04:08 -05:00
files="$(go fmt ./pkg/...)"
2018-03-16 19:59:58 -05:00
if [ -n "$files" ]; then
2018-03-16 20:15:06 -05:00
echo "Go code is not formatted:"
2018-03-16 19:59:58 -05:00
for file in $files; do
echo "----> $file"
done
exit 1
fi