chore: add fmt target

This provides a target that can be useful for developers. It will format
code according to our standards.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
This commit is contained in:
Andrew Rynhard 2019-09-11 21:32:07 +00:00
parent 980829708e
commit 2e8b570302

View File

@ -262,6 +262,10 @@ unit-tests-race: buildkitd
--opt build-arg:TESTPKGS=$(TESTPKGS) \
$(COMMON_ARGS)
.PHONY: fmt
fmt:
@docker run --rm -it -v $(PWD):/src -w /src golang:$(GO_VERSION) bash -c "export GO111MODULE=on; export GOPROXY=https://proxy.golang.org; cd /tmp && go mod init tmp && go get mvdan.cc/gofumpt && cd - && gofumpt -s -w ."
.PHONY: lint
lint: buildkitd
@$(BINDIR)/buildctl --addr $(BUILDKIT_HOST) \