diff options
author | Jake <jake@gnu.space> | 2017-06-05 20:54:15 +0000 |
---|---|---|
committer | Jake <jake@gnu.space> | 2017-06-05 20:54:15 +0000 |
commit | 8904b9d035e113e0c052acfed35c4ab5a6d6973b (patch) | |
tree | 942866927d945dcbe16028d682d73758a871acea /scripts/gofmtcheck.sh | |
download | terraform-provider-statuscake-8904b9d035e113e0c052acfed35c4ab5a6d6973b.tar.gz terraform-provider-statuscake-8904b9d035e113e0c052acfed35c4ab5a6d6973b.tar.zst terraform-provider-statuscake-8904b9d035e113e0c052acfed35c4ab5a6d6973b.zip |
initial commit
Diffstat (limited to 'scripts/gofmtcheck.sh')
-rwxr-xr-x | scripts/gofmtcheck.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh new file mode 100755 index 0000000..1c05581 --- /dev/null +++ b/scripts/gofmtcheck.sh | |||
@@ -0,0 +1,13 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | # Check gofmt | ||
4 | echo "==> Checking that code complies with gofmt requirements..." | ||
5 | gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) | ||
6 | if [[ -n ${gofmt_files} ]]; then | ||
7 | echo 'gofmt needs running on the following files:' | ||
8 | echo "${gofmt_files}" | ||
9 | echo "You can use the command: \`make fmt\` to reformat code." | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | exit 0 | ||