Skip to content

Commit

Permalink
Merge pull request openshift#185 from wking/ci-for-root-pkg-directory
Browse files Browse the repository at this point in the history
hack: Run Go tools over ./...
  • Loading branch information
openshift-merge-robot authored Aug 28, 2018
2 parents 245fc0f + dec4f3a commit 879a4c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
2 changes: 0 additions & 2 deletions hack/go-fmt.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh
# Example: ./hack/go-lint.sh installer/... tests/smoke

if [ "$IS_CONTAINER" != "" ]; then
for TARGET in "${@}"; do
find "${TARGET}" -name '*.go' ! -path '*/vendor/*' ! -path '*/.build/*' -exec gofmt -s -w {} \+
Expand Down
2 changes: 1 addition & 1 deletion hack/go-lint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Example: ./hack/go-lint.sh installer/... tests/smoke
# Example: ./hack/go-lint.sh installer/... pkg/... tests/smoke

if [ "$IS_CONTAINER" != "" ]; then
golint -set_exit_status "${@}"
Expand Down
16 changes: 2 additions & 14 deletions hack/go-vet.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/bin/sh
if [ "$IS_CONTAINER" != "" ]; then
cd ..
SOURCE_DIR="$(pwd)"
cd .. || exit
ROOT_DIR="$(pwd)"
TARGET_DIR="${ROOT_DIR}/openshift"
if [ "$SOURCE_DIR" != "$TARGET_DIR" ]; then
mv "$SOURCE_DIR" "$TARGET_DIR"
fi;
cd "${TARGET_DIR}/installer/" || exit
go vet "$1"
go vet "${@}"
else
for dir in "$@"
do
docker run --rm --env IS_CONTAINER='TRUE' -v "$PWD":/go/src/github.com/openshift/installer -w /go/src/github.com/openshift/installer quay.io/coreos/golang-testing ./hack/go-vet.sh "$dir"
done;
docker run --rm --env IS_CONTAINER='TRUE' -v "$PWD":/go/src/github.com/openshift/installer -w /go/src/github.com/openshift/installer quay.io/coreos/golang-testing ./hack/go-vet.sh "${@}"
fi;

0 comments on commit 879a4c9

Please sign in to comment.