Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ## help: 💡 Display available commands
  2. .PHONY: help
  3. help:
  4. @echo '⚡️ GoFiber/Fiber Development:'
  5. @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
  6. ## audit: 🚀 Conduct quality checks
  7. .PHONY: audit
  8. audit:
  9. go mod verify
  10. go vet ./...
  11. go run golang.org/x/vuln/cmd/govulncheck@latest ./...
  12. ## benchmark: 📈 Benchmark code performance
  13. .PHONY: benchmark
  14. benchmark:
  15. go test ./... -benchmem -bench=. -run=^Benchmark_$
  16. ## coverage: ☂️ Generate coverage report
  17. .PHONY: coverage
  18. coverage:
  19. go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -coverprofile=/tmp/coverage.out -covermode=atomic
  20. go tool cover -html=/tmp/coverage.out
  21. ## format: 🎨 Fix code format issues
  22. .PHONY: format
  23. format:
  24. go run mvdan.cc/gofumpt@latest -w -l .
  25. ## lint: 🚨 Run lint checks
  26. .PHONY: lint
  27. lint:
  28. go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 run ./...
  29. ## test: 🚦 Execute all tests
  30. .PHONY: test
  31. test:
  32. go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -shuffle=on
  33. ## longtest: 🚦 Execute all tests 10x
  34. .PHONY: longtest
  35. longtest:
  36. go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=15 -shuffle=on
  37. ## tidy: 📌 Clean and tidy dependencies
  38. .PHONY: tidy
  39. tidy:
  40. go mod tidy -v
  41. ## generate: ⚡️ Generate msgp && interface implementations
  42. .PHONY: generate
  43. generate:
  44. go install github.com/tinylib/msgp@latest
  45. go install github.com/vburenin/ifacemaker@975a95966976eeb2d4365a7fb236e274c54da64c
  46. go generate ./...