@@ -3,39 +3,64 @@ SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
33GOLANG_CI_YAML_PATH ?= ${ROOT_DIR}/golang-ci.yaml
44GOLANG_CI_ARGS ?= --allow-parallel-runners --timeout=5m --config=${GOLANG_CI_YAML_PATH}
55
6+ # #
7+ # Console Colors
8+ # #
9+ GREEN := $(shell printf "\033[0;32m")
10+ YELLOW := $(shell printf "\033[0;33m")
11+ WHITE := $(shell printf "\033[0;37m")
12+ CYAN := $(shell printf "\033[0;36m")
13+ RESET := $(shell printf "\033[0m")
14+
15+
16+ # #
17+ # Targets
18+ # #
19+ .PHONY : help
20+ help : # # Show this help
21+ @echo " Project: stackit-sdk-go"
22+ @echo ' Usage:'
23+ @echo " ${GREEN} make${RESET} ${YELLOW} <target>${RESET} "
24+ @echo ' '
25+ @echo ' Targets:'
26+ @awk ' BEGIN {FS = ":.*?## "} { \
27+ if (/^[a-zA-Z_-]+:.*? # #.*$$/) {printf " ${GREEN}%-21s${YELLOW}%s${RESET}\n", $$1, $$2} \
28+ else if (/^# # .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
29+ }' $(MAKEFILE_LIST) | sort
30+
631# SETUP AND TOOL INITIALIZATION TASKS
7- project-help :
32+ project-help : # # Show help for the project
833 @$(SCRIPTS_BASE ) /project.sh help
934
10- project-tools :
35+ project-tools : # # Install project tools
1136 @$(SCRIPTS_BASE ) /project.sh tools
1237
1338# LINT
14- lint-golangci-lint :
39+ lint-golangci-lint : # # Lint Go code
1540 @echo " >> Linting with golangci-lint"
1641 @$(SCRIPTS_BASE ) /lint-golangci-lint.sh " ${skip-non-generated-files} " " ${service} "
1742
18- lint-scripts :
43+ lint-scripts : # # Lint scripts
1944 @echo " >> Linting scripts"
2045 @cd ${ROOT_DIR} /scripts && golangci-lint run ${GOLANG_CI_ARGS}
2146
22- sync-tidy :
47+ sync-tidy : # # Sync and tidy dependencies
2348 @echo " >> Syncing and tidying dependencies"
2449 @$(SCRIPTS_BASE ) /sync-tidy.sh
2550
26- lint : sync-tidy
51+ lint : sync-tidy # # Lint all code
2752 @$(MAKE ) --no-print-directory lint-golangci-lint skip-non-generated-files=${skip-non-generated-files} service=${service}
2853
2954# TEST
30- test-go :
55+ test-go : # # Run Go tests
3156 @echo " >> Running Go tests"
3257 @$(SCRIPTS_BASE ) /test-go.sh " ${skip-non-generated-files} " " ${service} "
3358
34- test-scripts :
59+ test-scripts : # # Run tests for scripts
3560 @echo " >> Running Go tests for scripts"
3661 @go test $(ROOT_DIR ) /scripts/... ${GOTEST_ARGS}
3762
38- test :
63+ test : # # Run all tests
3964 @$(MAKE ) --no-print-directory test-go skip-non-generated-files=${skip-non-generated-files} service=${service}
4065
4166# AUTOMATIC TAG
@@ -45,4 +70,3 @@ sdk-tag-services:
4570
4671sdk-tag-core :
4772 @go run $(SCRIPTS_BASE ) /automatic_tag.go --update-type ${update-type} --ssh-private-key-file-path ${ssh-private-key-file-path} --target core;
48-
0 commit comments