Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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=. -count=4 -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. ## markdown: 🎨 Find markdown format issues (Requires markdownlint-cli2)
  26. .PHONY: markdown
  27. markdown:
  28. markdownlint-cli2 "**/*.md" "#vendor"
  29. ## lint: 🚨 Run lint checks
  30. .PHONY: lint
  31. lint:
  32. go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.2 run ./...
  33. ## test: 🚦 Execute all tests
  34. .PHONY: test
  35. test:
  36. go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -shuffle=on
  37. ## longtest: 🚦 Execute all tests 10x
  38. .PHONY: longtest
  39. longtest:
  40. go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=15 -shuffle=on
  41. ## tidy: 📌 Clean and tidy dependencies
  42. .PHONY: tidy
  43. tidy:
  44. go mod tidy -v
  45. ## betteralign: 📐 Optimize alignment of fields in structs
  46. .PHONY: betteralign
  47. betteralign:
  48. go run github.com/dkorunic/betteralign/cmd/betteralign@latest -test_files -generated_files -apply ./...
  49. ## generate: ⚡️ Generate msgp && interface implementations
  50. .PHONY: generate
  51. generate:
  52. go install github.com/tinylib/msgp@latest
  53. go install github.com/vburenin/ifacemaker@975a95966976eeb2d4365a7fb236e274c54da64c
  54. go generate ./...