forked from kubernetes-sigs/cluster-api-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0330adf
commit 4a80b8f
Showing
4 changed files
with
42 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
#!/bin/sh | ||
|
||
REPO_NAME=$(basename "${PWD}") | ||
if [ "$IS_CONTAINER" != "" ]; then | ||
for TARGET in "${@}"; do | ||
find "${TARGET}" -name '*.go' ! -path '*/vendor/*' ! -path '*/.build/*' -exec gofmt -s -w {} \+ | ||
done | ||
git diff --exit-code | ||
else | ||
docker run --rm \ | ||
docker run -it --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:/go/src/sigs.k8s.io/cluster-api-provider-aws:z" \ | ||
--workdir /go/src/sigs.k8s.io/cluster-api-provider-aws \ | ||
--volume "${PWD}:/go/src/github.com/openshift/${REPO_NAME}:z" \ | ||
--workdir "/go/src/github.com/openshift/${REPO_NAME}" \ | ||
openshift/origin-release:golang-1.10 \ | ||
./hack/go-fmt.sh "${@}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
#!/bin/sh | ||
# Example: ./hack/go-lint.sh cmd/... pkg/... | ||
# Example: ./hack/go-lint.sh installer/... pkg/... tests/smoke | ||
|
||
REPO_NAME=$(basename "${PWD}") | ||
if [ "$IS_CONTAINER" != "" ]; then | ||
golint -set_exit_status "${@}" | ||
else | ||
docker run --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:/go/src/sigs.k8s.io/cluster-api-provider-aws:z" \ | ||
--workdir /go/src/sigs.k8s.io/cluster-api-provider-aws \ | ||
--volume "${PWD}:/go/src/github.com/openshift/${REPO_NAME}:z" \ | ||
--workdir "/go/src/github.com/openshift/${REPO_NAME}" \ | ||
openshift/origin-release:golang-1.10 \ | ||
./hack/go-lint.sh "${@}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/bin/sh | ||
REPO_NAME=$(basename "${PWD}") | ||
if [ "$IS_CONTAINER" != "" ]; then | ||
go vet "${@}" | ||
else | ||
docker run --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:/go/src/sigs.k8s.io/cluster-api-provider-aws:z" \ | ||
--workdir /go/src/sigs.k8s.io/cluster-api-provider-aws \ | ||
--volume "${PWD}:/go/src/github.com/openshift/${REPO_NAME}:z" \ | ||
--workdir "/go/src/github.com/openshift/${REPO_NAME}" \ | ||
openshift/origin-release:golang-1.10 \ | ||
./hack/go-vet.sh "${@}" | ||
fi; |