-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·74 lines (56 loc) · 1.98 KB
/
Makefile
File metadata and controls
executable file
·74 lines (56 loc) · 1.98 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
64
65
66
67
68
69
70
71
72
73
74
.PHONY: tests
PHP_BIN=php
MYSQL_BIN=mysql
COMPOSER_PHAR=composer
current_dir=$(notdir $(mkfile_dir))
TESTS_DIR=./tests
VENDOR_DIR=./vendor
COVERAGE_DIR=$(TESTS_DIR)/reports/coverage
SQL_DIR=sql
REPORTS_DIR=./tools/reports
CP_BIN=/bin/cp
PHPUNIT_BIN=$(VENDOR_DIR)/bin/phpunit
PHPCS_BIN=$(VENDOR_DIR)/bin/phpcs
PHPMD_BIN=$(VENDOR_DIR)/bin/phpmd
PHPCBF_BIN=$(VENDOR_DIR)/bin/phpcbf
PSALM_BIN=$(VENDOR_DIR)/bin/psalm
PHPSTAN_BIN=$(VENDOR_DIR)/bin/phpstan
PHPMETRICS_BIN=$(VENDOR_DIR)/bin/phpmetrics
PHPCS_RULESET=vendor/flyeralarm/php-code-validator/ruleset.xml
PHPCS_RULESET=phpcs.xml
PHPCS_OPTIONS=--runtime-set ignore_warnings_on_exit true --encoding=UTF-8 --extensions=php -p
PHPCS_IGNORE="(staging.config.php|production.config.php)"
list: # Display this list
@cat Makefile \
| grep "^[a-z0-9_]\+:" \
| sed -r "s/:[^#]*?#?(.*)?/\r\t\t\t\t-\1/" \
| sed "s/^/ • make /" \
| sort
composer: install
install:
@$(COMPOSER_PHAR) install 2>&1
update:
@$(COMPOSER_PHAR) update
autoloader:
@$(COMPOSER_PHAR) dump-autoload
sniff:
@$(PHPCS_BIN) $(PHPCS_OPTIONS) --standard=$(PHPCS_RULESET) src public/ --ignore=$(PHPCS_IGNORE)
@$(PHPCS_BIN) $(PHPCS_OPTIONS) --standard=$(PHPCS_RULESET) tests/
beautify:
@$(PHPCBF_BIN) $(PHPCS_OPTIONS) --standard=$(PHPCS_RULESET) src public/ --ignore=$(PHPCS_IGNORE)
@$(PHPCBF_BIN) $(PHPCS_OPTIONS) --standard=$(PHPCS_RULESET) tests/
php-stan-analyse:
@$(PHPSTAN_BIN) analyse -c tools/phpstan.neon
report-html:
@$(PHPMETRICS_BIN) --report-html=$(REPORTS_DIR)/phpmetrics_$(shell date +%Y-%m-%d_%H-%M-%S) ./
################### Composer ###################
COMPOSE_FILE = docker-compose.yml
ci: # composer install
docker-compose run --rm composer install
@echo "$(GREEN)Done composer install$(END_COLORING)"
cu: # composer update
docker-compose run --rm composer update
@echo "$(GREEN)Done composer update$(END_COLORING)"
ca: # composer dump-autoload
docker-compose run --rm composer dump-autoload
@echo "$(GREEN)Done composer dump-autoload$(END_COLORING)"