go-chatgpt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

36 lines
1.4 KiB

  1. ##@ General
  2. # The help target prints out all targets with their descriptions organized
  3. # beneath their categories. The categories are represented by '##@' and the
  4. # target descriptions by '##'. The awk commands is responsible for reading the
  5. # entire set of makefiles included in this invocation, looking for lines of the
  6. # file as xyz: ## something, and then pretty-format the target and help. Then,
  7. # if there's a line with ##@ something, that gets pretty-printed as a category.
  8. # More info on the usage of ANSI control characters for terminal formatting:
  9. # https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
  10. # More info on the awk command:
  11. # http://linuxcommand.org/lc3_adv_awk.php
  12. .PHONY: help
  13. help: ## Display this help.
  14. @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
  15. ##@ Development
  16. .PHONY: test
  17. TEST_ARGS ?= -v
  18. TEST_TARGETS ?= ./...
  19. test: ## Test the Go modules within this package.
  20. @ echo ▶️ go test $(TEST_ARGS) $(TEST_TARGETS)
  21. go test $(TEST_ARGS) $(TEST_TARGETS)
  22. @ echo ✅ success!
  23. .PHONY: lint
  24. LINT_TARGETS ?= ./...
  25. lint: ## Lint Go code with the installed golangci-lint
  26. @ echo "▶️ golangci-lint run"
  27. golangci-lint run $(LINT_TARGETS)
  28. @ echo "✅ golangci-lint run"