Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: added init version of makefile #35

Merged
merged 1 commit into from
Feb 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.PHONY: all
all: build test

ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")

setup:
go get -u github.com/golang/lint/golint

build: fmt vet lint

fmt:
go fmt $(ALL_PACKAGES)

vet:
go vet $(ALL_PACKAGES)

lint:
@for p in $(ALL_PACKAGES); do \
echo "==> Linting $$p"; \
golint -set_exit_status $$p; \
done

test: fmt vet build
ENVIRONMENT=test go test $(ALL_PACKAGES)

test-cover-html:
@echo "mode: count" > coverage-all.out

$(foreach pkg, $(ALL_PACKAGES),\
ENVIRONMENT=test go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out -o out/coverage.html