-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·47 lines (40 loc) · 1.35 KB
/
Makefile
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
PHP_CS_RULES=@Symfony
PHP_MD_RULES=./phpmd.xml
test: vendor bin/validator-cli.jar
# see SYMFONY_DEPRECATIONS_HELPER in phpunit.xml.dist
rm -rf var/log/test.deprecations.log
APP_ENV=test XDEBUG_MODE=coverage vendor/bin/phpunit
bin/validator-cli.jar:
bash download-validator.sh
.PHONY: check-rules
check-rules: vendor
@echo "-- Checking coding rules using phpmd (see @SuppressWarning to bypass control)"
vendor/bin/phpmd src text $(PHP_MD_RULES)
@echo "-- Checking coding rules using phpstan"
vendor/bin/phpstan analyse -c phpstan.neon --error-format=raw
.PHONY: fix-style
fix-style: vendor
@echo "-- Fixing coding style using php-cs-fixer..."
vendor/bin/php-cs-fixer fix src --rules $(PHP_CS_RULES) --using-cache=no
vendor/bin/php-cs-fixer fix tests --rules $(PHP_CS_RULES) --using-cache=no
.PHONY: check-style
check-style: vendor
@echo "-- Checking coding style using php-cs-fixer (run 'make fix-style' if it fails)"
vendor/bin/php-cs-fixer fix src --rules $(PHP_CS_RULES) -v --dry-run --diff --using-cache=no
vendor/bin/php-cs-fixer fix tests --rules $(PHP_CS_RULES) -v --dry-run --diff --using-cache=no
.PHONY: vendor
vendor:
composer install
.PHONY: clean
clean:
rm -rf vendor
rm -rf var
rm -rf output
rm -f *.log
rm -f *.lock
rm -f package-lock.json
rm -f .php_cs.cache
rm -rf output
rm -rf node_modules
rm -rf .scannerwork
rm -rf sonar-scanner