From 145f21b7d06cae9aeb2b6bf67c5d022c47ee960f Mon Sep 17 00:00:00 2001 From: Aviral Takkar <39969667+avtakkar@users.noreply.github.com> Date: Tue, 21 May 2024 15:32:53 -0700 Subject: [PATCH] ci: add format check (#47) --- Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9d4a6ff..e2b8ae6 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,13 @@ include $(ROOT_DIR)/tests/Makefile .DEFAULT_GOAL := all .PHONY: all -all: lint test build ## Runs the peerd build targets in the correct order. +all: check test build ## Runs the peerd build targets in the correct order. + +.PHONY: check +check: check-format lint vet ## Check the source code. .PHONY: build -build: ## Build the peerd packages +build: ## Build the peerd packages. @echo "+ $@" @( $(GOBUILD) -o $(BIN_DIR)/peerd ./cmd/proxy ) @@ -70,6 +73,16 @@ endif info: header +.PHONY: check-format +check-format: ## Format the Go code. + @echo "+ $@" + @( test -z $(gofmt -l .) ) + +.PHONY: vet +vet: ## Run go vet. + @echo "+ $@" + @( go vet ./... ) + .PHONY: lint lint: ## Run linter. @echo "+ $@"