From e17f219ab8ff104f73e3c0f7515a7bb437b03d56 Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Fri, 28 Jun 2019 11:23:27 +0200 Subject: add provider without ressources and makefile --- scripts/gofmtcheck.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/gofmtcheck.sh (limited to 'scripts/gofmtcheck.sh') 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 @@ +#!/usr/bin/env bash + +# Check gofmt +echo "==> Checking that code complies with gofmt requirements..." +gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) +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 -- cgit v1.2.3