🛠 Always fmt before test or build
This commit is contained in:
parent
fb6c2fb941
commit
44c9736535
1 changed files with 4 additions and 4 deletions
8
Makefile
8
Makefile
|
|
@ -15,15 +15,15 @@ clean: ## Removes temporary and build files
|
||||||
rm -v $(COVEROUT) $(COVERHTML) $(OUT) || true
|
rm -v $(COVEROUT) $(COVERHTML) $(OUT) || true
|
||||||
|
|
||||||
.PHONY: fmt ## Runs go fmt
|
.PHONY: fmt ## Runs go fmt
|
||||||
fmt: ## Runs go fmt
|
fmt: $(SOURCES) ## Runs go fmt
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: ## Test application and generate coverage report
|
test: ## Test application and generate coverage report
|
||||||
rm $(COVEROUT) 2>/dev/null || true
|
$(MAKE) clean
|
||||||
$(MAKE) $(COVEROUT)
|
$(MAKE) $(COVEROUT)
|
||||||
|
|
||||||
$(COVEROUT): $(SOURCES)
|
$(COVEROUT): $(SOURCES) fmt
|
||||||
go test ./... -race -cover -coverprofile $@
|
go test ./... -race -cover -coverprofile $@
|
||||||
|
|
||||||
$(COVERHTML): $(COVEROUT)
|
$(COVERHTML): $(COVEROUT)
|
||||||
|
|
@ -39,5 +39,5 @@ open-report: report ## Open the coverage report in the default browser
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: $(OUT) ## Builds the application
|
build: $(OUT) ## Builds the application
|
||||||
|
|
||||||
$(OUT): $(SOURCES)
|
$(OUT): $(SOURCES) fmt
|
||||||
go build -o $@
|
go build -o $@
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue