Skip to content

Commit

Permalink
build: Add a fmt target which runs gofmt on all files.
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Campbell <[email protected]>
  • Loading branch information
Ian Campbell committed Dec 10, 2018
1 parent a0fe333 commit 7c8ee78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ test: test-unit ## run tests
test-coverage: ## run test coverage
./scripts/test/unit-with-coverage $(shell go list ./... | grep -vE '/vendor/|/e2e/')

.PHONY: fmt
fmt:
go list -f {{.Dir}} ./... | xargs gofmt -w -s -d

.PHONY: lint
lint: ## run all the lint tools
gometalinter --config gometalinter.json ./...
Expand Down
4 changes: 4 additions & 0 deletions docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ shell: dev ## alias for dev
lint: build_linter_image ## run linters
docker run -ti $(ENVVARS) $(MOUNTS) $(LINTER_IMAGE_NAME)

.PHONY: fmt
fmt:
docker run --rm $(ENVVARS) $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make fmt

.PHONY: vendor
vendor: build_docker_image vendor.conf ## download dependencies (vendor/) listed in vendor.conf
docker run -ti --rm $(ENVVARS) $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make vendor
Expand Down

0 comments on commit 7c8ee78

Please sign in to comment.