-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (52 loc) · 1.86 KB
/
Makefile
File metadata and controls
63 lines (52 loc) · 1.86 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
SHELL := /bin/bash
EXEC_PHP :=
##
## Проект
## ------
vendor: composer.json composer.lock ## Собрать vendor
$(EXEC_PHP) composer install
$(EXEC_PHP) touch vendor
##
## Контроль качества кода
## ----------------------
rector-fix: vendor ## Запустить исправление PHP кода при помощи Rector (https://getrector.org)
$(EXEC_PHP) vendor-bin/rector/vendor/bin/rector process
.PHONY: rector-fix
lint: vendor ## Проверить PHP code style при помощи PHP CS Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer)
$(EXEC_PHP) vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff --verbose
.PHONY: lint
fixcs: vendor ## Исправить ошибки PHP code style при помощи PHP CS Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer)
$(EXEC_PHP) vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff --verbose
.PHONY: fixcs
phpstan: vendor ## Запустить полный анализ PHP кода при помощи PHPStan (https://phpstan.org)
$(EXEC_PHP) vendor-bin/phpstan/vendor/bin/phpstan analyse --memory-limit 2G
.PHONY: phpstan
##
## Контроль зависимостей
## ----------------------
# -----------------------
help:
@awk ' \
BEGIN {RS=""; FS="\n"} \
function printCommand(line) { \
split(line, command, ":.*?## "); \
printf "\033[32m%-28s\033[0m %s\n", command[1], command[2]; \
} \
/^[0-9a-zA-Z_-]+: [0-9a-zA-Z_-]+\n[0-9a-zA-Z_-]+: .*?##.*$$/ { \
split($$1, alias, ": "); \
sub(alias[2] ":", alias[2] " (" alias[1] "):", $$2); \
printCommand($$2); \
next; \
} \
$$1 ~ /^[0-9a-zA-Z_-]+: .*?##/ { \
printCommand($$1); \
next; \
} \
/^##(\n##.*)+$$/ { \
gsub("## ?", "\033[33m", $$0); \
print $$0; \
next; \
} \
' $(MAKEFILE_LIST) && printf "\033[0m"
.PHONY: help
.DEFAULT_GOAL := help