diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | GNUmakefile | 3 | ||||
-rwxr-xr-x | scripts/changelog-links.sh | 20 | ||||
-rwxr-xr-x | scripts/errcheck.sh | 4 | ||||
-rwxr-xr-x | scripts/gofmtcheck.sh | 2 | ||||
-rwxr-xr-x | scripts/gogetcookie.sh | 9 |
6 files changed, 22 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml index 82f7e25..a20fc58 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -18,6 +18,7 @@ script: | |||
18 | - make test | 18 | - make test |
19 | - make vet | 19 | - make vet |
20 | - make website-test | 20 | - make website-test |
21 | - make shellcheck | ||
21 | 22 | ||
22 | matrix: | 23 | matrix: |
23 | fast_finish: true | 24 | fast_finish: true |
@@ -26,7 +27,6 @@ matrix: | |||
26 | 27 | ||
27 | cache: | 28 | cache: |
28 | directories: | 29 | directories: |
29 | - $GOPATH/src | ||
30 | - $HOME/.cache/go-build | 30 | - $HOME/.cache/go-build |
31 | - $HOME/gopath/pkg/mod | 31 | - $HOME/gopath/pkg/mod |
32 | 32 | ||
diff --git a/GNUmakefile b/GNUmakefile index f5f0c29..7750632 100644 --- a/GNUmakefile +++ b/GNUmakefile | |||
@@ -25,6 +25,9 @@ vet: | |||
25 | exit 1; \ | 25 | exit 1; \ |
26 | fi | 26 | fi |
27 | 27 | ||
28 | shellcheck: | ||
29 | shellcheck scripts/* | ||
30 | |||
28 | fmt: | 31 | fmt: |
29 | gofmt -w $(GOFMT_FILES) | 32 | gofmt -w $(GOFMT_FILES) |
30 | 33 | ||
diff --git a/scripts/changelog-links.sh b/scripts/changelog-links.sh index 303341b..83e918e 100755 --- a/scripts/changelog-links.sh +++ b/scripts/changelog-links.sh | |||
@@ -11,21 +11,21 @@ | |||
11 | set -e | 11 | set -e |
12 | 12 | ||
13 | if [[ ! -f CHANGELOG.md ]]; then | 13 | if [[ ! -f CHANGELOG.md ]]; then |
14 | echo "ERROR: CHANGELOG.md not found in pwd." | 14 | echo "ERROR: CHANGELOG.md not found in pwd." |
15 | echo "Please run this from the root of the terraform provider repository" | 15 | echo "Please run this from the root of the terraform provider repository" |
16 | exit 1 | 16 | exit 1 |
17 | fi | 17 | fi |
18 | 18 | ||
19 | if [[ `uname` == "Darwin" ]]; then | 19 | if [[ $(uname) == "Darwin" ]]; then |
20 | echo "Using BSD sed" | 20 | echo "Using BSD sed" |
21 | SED="sed -i.bak -E -e" | 21 | SED="sed -i.bak -E -e" |
22 | else | 22 | else |
23 | echo "Using GNU sed" | 23 | echo "Using GNU sed" |
24 | SED="sed -i.bak -r -e" | 24 | SED="sed -i.bak -r -e" |
25 | fi | 25 | fi |
26 | 26 | ||
27 | PROVIDER_URL="https:\/\/github.com\/terraform-providers\/terraform-provider-statuscake\/issues" | 27 | PROVIDER_URL="https:\\/\\/github.com\\/terraform-providers\\/terraform-provider-statuscake\\/issues" |
28 | 28 | ||
29 | $SED "s/GH-([0-9]+)/\[#\1\]\($PROVIDER_URL\/\1\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md | 29 | $SED "s/GH-([0-9]+)/\\[#\\1\\]\\($PROVIDER_URL\\/\\1\\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md |
30 | 30 | ||
31 | rm CHANGELOG.md.bak | 31 | rm CHANGELOG.md.bak |
diff --git a/scripts/errcheck.sh b/scripts/errcheck.sh index 15464f5..ebcc7b3 100755 --- a/scripts/errcheck.sh +++ b/scripts/errcheck.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | # Check gofmt | 3 | # Check gofmt |
4 | echo "==> Checking for unchecked errors..." | 4 | echo "==> Checking for unchecked errors..." |
5 | 5 | ||
6 | if ! which errcheck > /dev/null; then | 6 | if ! command -v errcheck > /dev/null; then |
7 | echo "==> Installing errcheck..." | 7 | echo "==> Installing errcheck..." |
8 | go get -u github.com/kisielk/errcheck | 8 | go get -u github.com/kisielk/errcheck |
9 | fi | 9 | fi |
@@ -12,7 +12,7 @@ err_files=$(errcheck -ignoretests \ | |||
12 | -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \ | 12 | -ignore 'github.com/hashicorp/terraform/helper/schema:Set' \ |
13 | -ignore 'bytes:.*' \ | 13 | -ignore 'bytes:.*' \ |
14 | -ignore 'io:Close|Write' \ | 14 | -ignore 'io:Close|Write' \ |
15 | $(go list ./...| grep -v /vendor/)) | 15 | "$(go list ./...| grep -v /vendor/)") |
16 | 16 | ||
17 | if [[ -n ${err_files} ]]; then | 17 | if [[ -n ${err_files} ]]; then |
18 | echo 'Unchecked errors found in the following places:' | 18 | echo 'Unchecked errors found in the following places:' |
diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh index 1c05581..3856e52 100755 --- a/scripts/gofmtcheck.sh +++ b/scripts/gofmtcheck.sh | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | # Check gofmt | 3 | # Check gofmt |
4 | echo "==> Checking that code complies with gofmt requirements..." | 4 | echo "==> Checking that code complies with gofmt requirements..." |
5 | gofmt_files=$(gofmt -l `find . -name '*.go' | grep -v vendor`) | 5 | gofmt_files=$(gofmt -l "$(find . -name '*.go' | grep -v vendor)") |
6 | if [[ -n ${gofmt_files} ]]; then | 6 | if [[ -n ${gofmt_files} ]]; then |
7 | echo 'gofmt needs running on the following files:' | 7 | echo 'gofmt needs running on the following files:' |
8 | echo "${gofmt_files}" | 8 | echo "${gofmt_files}" |
diff --git a/scripts/gogetcookie.sh b/scripts/gogetcookie.sh index 37955fc..5ab7e93 100755 --- a/scripts/gogetcookie.sh +++ b/scripts/gogetcookie.sh | |||
@@ -1,9 +1,10 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | touch ~/.gitcookies | 3 | touch ~/.gitcookies |
4 | chmod 0600 ~/.gitcookies | 4 | chmod 0600 ~/.gitcookies |
5 | 5 | ||
6 | git config --global http.cookiefile ~/.gitcookies | 6 | git config --global http.cookiefile ~/.gitcookies |
7 | 7 | ||
8 | tr , \\t <<\__END__ >>~/.gitcookies | 8 | tr , \\t <<\__END__ >>~/.gitcookies |
9 | .googlesource.com,TRUE,/,TRUE,2147483647,o,git-alexandre.namebla.gmail.com=1/OtfvUDYg3VAHfIxaqjAuv8MJqu6--gSU_zSkD8YkKPc | 9 | .googlesource.com,TRUE,/,TRUE,2147483647,o,git-alexandre.namebla.gmail.com=1/OtfvUDYg3VAHfIxaqjAuv8MJqu6--gSU_zSkD8YkKPc |
10 | __END__ | ||