-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 1.11 KB
/
Copy pathMakefile
File metadata and controls
49 lines (38 loc) · 1.11 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: ${TARGETS}
.DEFAULT_GOAL := help
define say =
echo "$1"
endef
define say_red =
echo "\033[31m$1\033[0m"
endef
define say_green =
echo "\033[32m$1\033[0m"
endef
define say_yellow =
echo "\033[33m$1\033[0m"
endef
define say_cyan =
echo "\033[1m\033[36m$1\033[0m\033[21m"
endef
help:
@$(call say_yellow,"Usage:")
@$(call say," make [command]")
@$(call say,"")
@$(call say_yellow,"Available commands:")
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%s\033[0m___%s\n", $$1, $$2}' | column -ts___
install: ## Install project
@$(call say_cyan,"==\> Install Composer dependencies")
@composer install -n
cs-fix: ## Fix coding standard
@vendor/bin/php-cs-fixer fix
cs-lint: ## Lint php code source
@$(call say_cyan,"==\> Check style")
@vendor/bin/php-cs-fixer fix --dry-run --diff --no-interaction -v
phpstan: ## Run PHPStan
@vendor/bin/phpstan analyze -c phpstan.neon -l max src/ tests/
test: cs-lint phpstan ## Launch tests
@rm -rf ./tests/Fixtures/app/cache/*
@$(call say_cyan,"==\> Launch unit tests")
@vendor/bin/phpunit