go-prompt/Makefile

27 lines
594 B
Makefile
Raw Normal View History

2017-07-03 15:52:39 +00:00
.DEFAULT_GOAL := help
2017-07-17 20:25:06 +00:00
.PHONY: setup
2017-07-03 15:52:39 +00:00
setup: ## Setup for required tools.
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/goimports
2017-07-17 20:25:06 +00:00
go get golang.org/x/tools/cmd/stringer
go get github.com/pkg/term
2017-07-03 15:52:39 +00:00
2017-07-17 20:25:06 +00:00
.PHONY: fmt
2017-07-03 15:52:39 +00:00
fmt: ## Formatting source codes.
2017-07-17 20:32:25 +00:00
@goimports -w .
2017-07-03 15:52:39 +00:00
2017-07-17 20:25:06 +00:00
.PHONY: lint
2017-07-03 15:52:39 +00:00
lint: ## Run golint and go vet.
2017-07-17 20:32:25 +00:00
@golint .
@go vet .
2017-07-03 15:52:39 +00:00
2017-07-17 20:25:06 +00:00
.PHONY: test
2017-07-03 15:52:39 +00:00
test: ## Run the tests.
2017-07-17 20:32:25 +00:00
@go test .
2017-07-03 15:52:39 +00:00
2017-07-17 20:25:06 +00:00
.PHONY: help
2017-07-03 15:52:39 +00:00
help: ## Show help text
@echo "Commands:"
2017-07-17 20:25:06 +00:00
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-10s\033[0m %s\n", $$1, $$2}'