Created
March 21, 2014 09:34
-
-
Save melekes/9682712 to your computer and use it in GitHub Desktop.
Colored Makefile for Golang projects
This file contains hidden or 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
NO_COLOR=\033[0m | |
OK_COLOR=\033[32;01m | |
ERROR_COLOR=\033[31;01m | |
WARN_COLOR=\033[33;01m | |
DEPS = $(go list -f '{{range .TestImports}}{{.}} {{end}}' ./...) | |
deps: | |
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)" | |
@go get -d -v ./... | |
@echo $(DEPS) | xargs -n1 go get -d | |
updatedeps: | |
@echo "$(OK_COLOR)==> Updating all dependencies$(NO_COLOR)" | |
@go get -d -v -u ./... | |
@echo $(DEPS) | xargs -n1 go get -d -u | |
format: | |
@echo "$(OK_COLOR)==> Formatting$(NO_COLOR)" | |
go fmt ./... | |
test: deps | |
@echo "$(OK_COLOR)==> Testing$(NO_COLOR)" | |
go test ./... | |
lint: | |
@echo "$(OK_COLOR)==> Linting$(NO_COLOR)" | |
golint . | |
all: format lint test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment