mtfosbot/vendor/github.com/gin-gonic/gin/Makefile

63 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2018-08-14 09:25:34 +00:00
GOFMT ?= gofmt "-s"
PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
2018-11-16 03:10:19 +00:00
VETPACKAGES ?= $(shell go list ./... | grep -v /vendor/ | grep -v /examples/)
2018-08-14 09:25:34 +00:00
GOFILES := $(shell find . -name "*.go" -type f -not -path "./vendor/*")
2018-11-16 03:10:19 +00:00
all: install
2018-08-14 09:25:34 +00:00
install: deps
govendor sync
.PHONY: test
test:
2018-11-16 03:10:19 +00:00
sh coverage.sh
2018-08-14 09:25:34 +00:00
.PHONY: fmt
fmt:
$(GOFMT) -w $(GOFILES)
.PHONY: fmt-check
fmt-check:
# get all go files and run go fmt on them
@diff=$$($(GOFMT) -d $(GOFILES)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi;
vet:
2018-11-16 03:10:19 +00:00
go vet $(VETPACKAGES)
2018-08-14 09:25:34 +00:00
deps:
@hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/kardianos/govendor; \
fi
@hash embedmd > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/campoy/embedmd; \
fi
embedmd:
embedmd -d *.md
.PHONY: lint
lint:
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/golang/lint/golint; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
.PHONY: misspell-check
misspell-check:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/client9/misspell/cmd/misspell; \
fi
misspell -error $(GOFILES)
.PHONY: misspell
misspell:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/client9/misspell/cmd/misspell; \
fi
misspell -w $(GOFILES)