-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 1001 Bytes
/
Makefile
File metadata and controls
28 lines (20 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.PHONY: help, create_challenge, dev, test, test-group
# Variables
PORT ?= 8000
# Commands
help: ## Display this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# Get the arg parameter and give it to ./scripts/new_challenge.sh
create_challenge: ## Create a new challenge file (make create_challenge code=CHALLENGE_CODE)
@$(eval code ?=)
./scripts/new_challenge.sh $(code)
dev: ## Launch PHP dev server at localhost:8000 for example
php -S localhost:$(PORT)
test: ## Run all phpunit tests
./vendor/bin/phpunit tests
test-group: ## Run phpunit tests based on the group in "group" variable (make test-group group=GROUP_NAME)
./vendor/bin/phpunit --group $(group) tests
lint: ## Run Psalm static analysis
./vendor/bin/psalm
lint-group: ## Run Psalm static analysis based on the group in "group" variable (make lint-group group=GROUP_NAME)
./vendor/bin/psalm src/Challenges/$(group)/*.php