Skip to content

Commit

Permalink
Merge pull request #59 from mackerelio/gofmt_on_travis
Browse files Browse the repository at this point in the history
[nit] Check gofmt -s on Travis
  • Loading branch information
Songmu committed Jun 23, 2016
2 parents de4a276 + 6eac2fb commit c882544
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BUILD_FLAGS = -ldflags "\
check_variables:
echo "CURRENT_VERSION: ${CURRENT_VERSION}"

all: clean cross lint test
all: clean cross lint gofmt test

test: testdeps
go test -v ./...
Expand All @@ -21,9 +21,15 @@ LINT_RET = .golint.txt
lint: testdeps
go vet
rm -f $(LINT_RET)
golint ./... | tee .golint.txt
golint ./... | tee $(LINT_RET)
test ! -s $(LINT_RET)

GOFMT_RET = .gofmt.txt
gofmt: testdeps
rm -f $(GOFMT_RET)
gofmt -s -d *.go | tee $(GOFMT_RET)
test ! -s $(GOFMT_RET)

cross: deps
goxc -tasks='xc archive' -bc 'linux,!arm darwin' -d . -build-ldflags "-X main.Version=$(CURRENT_VERSION)" -resources-include='README*'
cp -p $(PWD)/snapshot/linux_amd64/mkr $(PWD)/snapshot/mkr_linux_amd64
Expand Down Expand Up @@ -62,4 +68,4 @@ clean:
cover: testdeps
goveralls

.PHONY: test build cross lint deps testdeps clean deb rpm release cover
.PHONY: test build cross lint gofmt deps testdeps clean deb rpm release cover

0 comments on commit c882544

Please sign in to comment.