-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
65 lines (52 loc) · 2.27 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: analyze fix-code clean test test-with-integration coverage coverage-with-integration validation integration-test integration-coverage
analyze: | vendor
$(COMPOSER) exec -v parallel-lint -- src
$(COMPOSER) exec -v php-cs-fixer -- fix --dry-run -v
$(COMPOSER) exec -v unused_scanner -- .unused.dist.php
$(COMPOSER) exec -v security-checker -- security:check
$(COMPOSER) exec -v phpcpd -- --fuzzy src
$(COMPOSER) exec -v phpmd -- src ansi codesize,controversial,design,naming,unusedcode
$(COMPOSER) exec -v phpa -- src
$(COMPOSER) exec -v phpstan -- analyse
$(COMPOSER) exec -v psalm -- src
clean:
rm -rf composer.phar
rm -rf vendor/
rm -rf composer.lock
rm -rf .php-cs-fixer.cache
rm -rf .phpunit.result.cache
fix-code: | vendor
$(COMPOSER) normalize
$(COMPOSER) exec -v php-cs-fixer -- fix -v
test: | vendor
$(COMPOSER) exec -v phpunit
test-with-integration: | vendor
$(COMPOSER) exec -v phpunit -- --group default,integration
coverage: | vendor
@if [ -z "`php -v | grep -i 'xdebug'`" ]; then echo "You need to install Xdebug in order to do this action"; exit 1; fi
XDEBUG_MODE=coverage $(COMPOSER) exec -v phpunit -- --coverage-text --color
coverage-with-integration: | vendor
@if [ -z "`php -v | grep -i 'xdebug'`" ]; then echo "You need to install Xdebug in order to do this action"; exit 1; fi
XDEBUG_MODE=coverage $(COMPOSER) exec -v phpunit -- --group default,integration --coverage-text --color
integration-test: | vendor
$(COMPOSER) exec -v phpunit -- --group integration
integration-coverage: | vendor
@if [ -z "`php -v | grep -i 'xdebug'`" ]; then echo "You need to install Xdebug in order to do this action"; exit 1; fi
XDEBUG_MODE=coverage $(COMPOSER) exec -v phpunit -- --group integration --coverage-text --color
validation: fix-code analyze test-with-integration coverage-with-integration
vendor: composer.json
$(COMPOSER) install --optimize-autoloader --prefer-dist
touch vendor
composer.phar:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --quiet
rm composer-setup.php
# Check Composer installation
ifneq ($(shell command -v composer > /dev/null ; echo $$?), 0)
ifneq ($(MAKECMDGOALS),composer.phar)
$(shell $(MAKE) composer.phar)
endif
COMPOSER=php composer.phar
else
COMPOSER=composer
endif