Skip to content

Commit

Permalink
fix format.check target
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasjarosch committed Jul 19, 2019
1 parent 644efbc commit 50db52d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions a_main-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions templates/makefile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ GOBASE=$(shell pwd)
GOBIN=$(GOBASE)/bin
GODIRS = $(shell go list -f '{{.Dir}}' ./...)
COMMIT=$(shell git rev-parse --short HEAD)
GOFILES=$(shell go list -f {{.Dir}} ./... | grep -v /vendor/)

DOCKER_IMAGE="docker.coozzy.ch/<< .Service.Namespace >>-<< .Service.Name >>"
DOCKER_IMAGE="<< .Docker.Registry >>/<< .Service.Namespace >>-<< .Service.Name >>"
DOCKER_TAG="v-${COMMIT}-dev"
PROTO_SRC="<< .Protobuf.Path >>"

.PHONY: build
build:
build: check vendor
@echo "--> building"
@go build -o ${GOBIN}/<< .Service.Name >> ./cmd/<< .Service.Name >>/main.go

Expand All @@ -17,6 +18,11 @@ run:
@echo "--> starting locally"
@LOG_LEVEL=debug go run cmd/<< .Service.Name >>/main.go

.PHONY: vendor
vendor:
@echo "--> vendoring dependencies"
@go mod vendor

.PHONY: grpcui
grpcui:
@grpcui -proto ${PROTO_SRC} -port 5000 -plaintext localhost:50051
Expand All @@ -28,7 +34,7 @@ clean:
@rm -rf $(GOBIN)/*

.PHONY: docker
docker:
docker: check vendor
@echo "--> building docker image"
docker build . -t ${DOCKER_IMAGE}:${DOCKER_TAG} -f ./Dockerfile

Expand All @@ -46,8 +52,10 @@ check: format.check lint

.PHONY: format.check
format.check: tools.goimports
@echo "--> checking code formatting with 'goimports'"
@goimports -w -l .

@echo "--> checking code formatting with 'goimports'"
@goimports -w ${GOFILES}


.PHONY: lint
lint: tools.golint
Expand Down

0 comments on commit 50db52d

Please sign in to comment.