aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorAlexandre Garand <alexandre.garand@fretlink.com>2019-06-28 11:23:27 +0200
committerAlexandre Garand <alexandre.garand@fretlink.com>2019-06-28 11:23:27 +0200
commite17f219ab8ff104f73e3c0f7515a7bb437b03d56 (patch)
treede70594e9645a382a3a4cb4addec966e96bf71eb /scripts
parente2966ba7a0ba5e3f87787f0a276ca5f7f6b21bd7 (diff)
downloadterraform-provider-mailgun-e17f219ab8ff104f73e3c0f7515a7bb437b03d56.tar.gz
terraform-provider-mailgun-e17f219ab8ff104f73e3c0f7515a7bb437b03d56.tar.zst
terraform-provider-mailgun-e17f219ab8ff104f73e3c0f7515a7bb437b03d56.zip
add provider without ressources and makefile
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/errcheck.sh24
-rwxr-xr-xscripts/gofmtcheck.sh13
2 files changed, 37 insertions, 0 deletions
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 @@
1#!/usr/bin/env bash
2
3# Check gofmt
4echo "==> Checking for unchecked errors..."
5
6if ! which errcheck > /dev/null; then
7 echo "==> Installing errcheck..."
8 go get -u github.com/kisielk/errcheck
9fi
10
11err_files=$(errcheck -ignoretests \
12 -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \
13 -ignore 'bytes:.*' \
14 -ignore 'io:Close|Write' \
15 $(go list ./...| grep -v /vendor/))
16
17if [[ -n ${err_files} ]]; then
18 echo 'Unchecked errors found in the following places:'
19 echo "${err_files}"
20 echo "Please handle returned errors. You can check directly with \`make errcheck\`"
21 exit 1
22fi
23
24exit 0
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
4echo "==> Checking that code complies with gofmt requirements..."
5gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`)
6if [[ -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
11fi
12
13exit 0