Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
add verify-gofmt script
Browse files Browse the repository at this point in the history
* due to changes in gofmt in 1.11
  • Loading branch information
rphillips committed Oct 16, 2018
1 parent a7768df commit dc50254
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ release: \
check \
_output/release/bootkube.tar.gz \

check: gofmt
check:
ifdef TERRAFORM
$(TERRAFORM) fmt -check ; if [ ! $$? -eq 0 ]; then exit 1; fi
else
@echo -e "\e[91mSkipping terraform lint. terraform binary not available.\e[0m"
endif
@go vet $(shell go list ./... | grep -v '/vendor/')
@./scripts/verify-gopkg.sh
@./build/verify-gofmt.sh
@go test -v $(shell go list ./... | grep -v '/vendor/\|/e2e')

gofmt:
Expand Down
10 changes: 10 additions & 0 deletions build/verify-gofmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euo pipefail

BOOTKUBE_ROOT=$(git rev-parse --show-toplevel)
sudo rkt run \
--volume bk,kind=host,source=${BOOTKUBE_ROOT} \
--mount volume=bk,target=/go/src/github.com/kubernetes-incubator/bootkube \
--insecure-options=image docker://golang:1.11.1 --exec /bin/bash -- -c \
"cd /go/src/github.com/kubernetes-incubator/bootkube && make gofmt"

0 comments on commit dc50254

Please sign in to comment.