Skip to content

Commit d4c2346

Browse files
author
Alex Johnson
authored
chore(Makefile): add make mocks target (ignite#2680)
* add mocks make target and PHONY target * review suggestion
1 parent de34ff9 commit d4c2346

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,21 @@ build:
2222
@-mkdir -p $(BUILD_FOLDER) 2> /dev/null
2323
@go build $(BUILD_FLAGS) -o $(BUILD_FOLDER) ./...
2424

25+
## mocks: generate mocks
26+
mocks:
27+
@echo Generating mocks
28+
@go install github.com/vektra/mockery/v2
29+
@go generate ./...
30+
31+
2532
## clean: Clean build files. Also runs `go clean` internally.
2633
clean:
2734
@echo Cleaning build cache...
2835
@-rm -rf $(BUILD_FOLDER) 2> /dev/null
2936
@go clean ./...
3037

38+
.PHONY: install build mocks clean
39+
3140
## govet: Run go vet.
3241
govet:
3342
@echo Running go vet...
@@ -45,6 +54,8 @@ lint:
4554
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.2
4655
@golangci-lint run --out-format=tab --issues-exit-code=0
4756

57+
.PHONY: govet format lint
58+
4859
## test-unit: Run the unit tests.
4960
test-unit:
5061
@echo Running unit tests...
@@ -58,11 +69,15 @@ test-integration: install
5869
## test: Run unit and integration tests.
5970
test: govet test-unit test-integration
6071

72+
.PHONY: test-unit test-integration test
73+
6174
help: Makefile
6275
@echo
6376
@echo " Choose a command run in "$(PROJECT_NAME)", or just run 'make' for install"
6477
@echo
6578
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
6679
@echo
6780

81+
.PHONY: help
82+
6883
.DEFAULT_GOAL := install

0 commit comments

Comments
 (0)