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/errcheck.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/errcheck.sh (limited to 'scripts/errcheck.sh') diff --git a/scripts/errcheck.sh b/scripts/errcheck.sh new file mode 100755 index 0000000..15464f5 --- /dev/null +++ b/scripts/errcheck.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Check gofmt +echo "==> Checking for unchecked errors..." + +if ! which errcheck > /dev/null; then + echo "==> Installing errcheck..." + go get -u github.com/kisielk/errcheck +fi + +err_files=$(errcheck -ignoretests \ + -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \ + -ignore 'bytes:.*' \ + -ignore 'io:Close|Write' \ + $(go list ./...| grep -v /vendor/)) + +if [[ -n ${err_files} ]]; then + echo 'Unchecked errors found in the following places:' + echo "${err_files}" + echo "Please handle returned errors. You can check directly with \`make errcheck\`" + exit 1 +fi + +exit 0 -- cgit v1.2.3