Skip to content

Commit

Permalink
Update ignite/templates/app/files/Makefile.plush
Browse files Browse the repository at this point in the history
Co-authored-by: Danilo Pantani <danpantani@gmail.com>
  • Loading branch information
julienrbrt and Pantani committed Sep 19, 2024
1 parent 8c3ee6d commit 7f12c0b
Showing 1 changed file with 68 additions and 1 deletion.
69 changes: 68 additions & 1 deletion ignite/templates/app/files/Makefile.plush
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,71 @@ lint-fix:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --fix --timeout 15m

.PHONY: lint lint-fix
.PHONY: lint lint-fix

###############################################################################
### Development ###
###############################################################################

## govet: Run go vet.
govet:
@echo Running go vet...
@go vet ./...

## govulncheck: Run govulncheck
govulncheck:
@echo Running govulncheck...
@go run golang.org/x/vuln/cmd/govulncheck ./...

FIND_ARGS := -name '*.go' -type f -not -name '*.pb.go' -not -name '*.pb.gw.go' -not -path './api/*'

## format: Run gofumpt and goimports.
format:
@echo Formatting...
@go install mvdan.cc/gofumpt
@go install golang.org/x/tools/cmd/goimports
@find . $(FIND_ARGS) | xargs gofumpt -w .
@find . $(FIND_ARGS) | xargs goimports -w -local github.com/ignite/network

.PHONY: format govet govulncheck


###############################################################################
### Test ###
###############################################################################

## test-unit: Run the unit tests.
test-unit:
@echo Running unit tests...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m $(PACKAGES)

## test-race: Run the unit tests checking for race conditions
test-race:
@echo Running unit tests with race condition reporting...
@VERSION=$(VERSION) go test -mod=readonly -v -race -timeout 30m $(PACKAGES)

## test-cover: Run the unit tests and create a coverage html report
test-cover:
@echo Running unit tests and creating coverage report...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic $(PACKAGES)
@go tool cover -html=$(COVER_FILE) -o $(COVER_HTML_FILE)
@rm $(COVER_FILE)

## bench: Run the unit tests with benchmarking enabled
bench:
@echo Running unit tests with benchmarking...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -bench=. $(PACKAGES)

## test: Run unit and integration tests.
test: govet govulncheck test-unit

.PHONY: test test-unit test-race test-cover bench

help: Makefile
@echo
@echo " Choose a command run in "$(APPNAME)", or just run 'make' for install"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo

.PHONY: help

0 comments on commit 7f12c0b

Please sign in to comment.