Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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@v1.13.0 -f testname -- ./... -race -count=1 -coverprofile=coverage.out -covermode=atomic
  20. go tool cover -html=coverage.out -o coverage.html
  21. open coverage.html &
  22. ## format: 🎨 Fix code format issues
  23. .PHONY: format
  24. format:
  25. go run mvdan.cc/gofumpt@latest -w -l .
  26. ## benchfmt: 📝 Format README benchmark lines
  27. .PHONY: benchfmt
  28. benchfmt:
  29. go run ./scripts/format_benchmarks.go
  30. ## lint: 🚨 Run lint checks
  31. .PHONY: lint
  32. lint:
  33. go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.1 run ./...
  34. ## modernize: ♻️ Check for outdated patterns
  35. .PHONY: modernize
  36. modernize:
  37. go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test=false ./...
  38. ## test: 🚦 Execute all tests
  39. .PHONY: test
  40. test:
  41. go run gotest.tools/gotestsum@v1.13.0 -f testname -- ./... -race -count=1 -shuffle=on
  42. ## tidy: 📌 Clean and tidy dependencies
  43. .PHONY: tidy
  44. tidy:
  45. go mod tidy -v