1
0
Fork 0
mirror of https://gitea.com/jonasfranz/staletea synced 2024-05-09 20:06:04 +02:00
staletea/Makefile
Jonas Franz b89d0ba175
Add fmt check
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2019-06-04 11:00:58 +02:00

27 lines
638 B
Makefile

.PHONY: golangci-lint
golangci-lint:
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.16.0; \
fi
golangci-lint run
.PHONY: lint
lint:
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u golang.org/x/lint/golint; \
fi
golint ./...
.PHONY: fmt-check
fmt-check:
# get all go files and run go fmt on them
@diff=$$(go fmt ./...); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi;
.PHONY: fmt
fmt:
go fmt ./...