opentofu/scripts/gofmtcheck.sh
James Nugent 6d6487e288 Make gofmt errors fail build and add make fmt
We may want to consider requiring `gofmt -s` compliance in future
builds, but for now we just use `gofmt`.
2015-12-17 12:35:13 -05:00

14 lines
330 B
Bash
Executable File

#!/usr/bin/env bash
# Check gofmt
echo "==> Checking that code complies with gofmt requirements..."
gofmt_files=$(gofmt -l .)
if [[ -n ${gofmt_files} ]]; then
echo 'gofmt needs running on the following files:'
echo "${gofmt_files}"
echo "You can use the command: \`make fmt\` to reformat code."
exit 1
fi
exit 0