Site vitrine pour donner de lumière aux petits artisans
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

100 lines
2.8 KiB

all:
@echo ""
@echo "Available targets:"
@echo ""
@echo "* install Install project"
@echo " * build Build the app, used in Dockerfile"
@echo " * composer Install Composer vendors"
@echo " * setup Set up the app, used in docker entrypoint"
@echo " * cc Clear and warmup Symfony cache"
@echo ""
@echo "* code-qa Code quality checks (uses in CI)"
@echo " * lint Check for files validations"
@echo " * cs-check Check code styling"
@echo " * phpstan-ci Static code analysis"
@echo " * psalm Static code analysis"
@echo " * phpmd PHP Mess Detector (and generates report in ./reports directory)"
@echo " * security-check Third-party composer libraries security check"
@echo " * phpmetrics Metrics about PHP project and classes (and generates report in ./reports directory)"
@echo ""
@echo "* tests Run tests"
@echo " * phpunit Run PHPUnit tests (and generates report in ./reports directory)"
@echo ""
@echo "* cs-fix Self-correcting code styling"
@echo "* cs Dry-run code styling check"
@echo "* phpstan Static code analysis with progress bar"
.PHONY: install
install: build setup
.PHONY: build
build: composer
.PHONY: setup
setup: cc
.PHONY: composer
composer:
ifeq ($(APP_ENV), prod)
php composer.phar install --no-dev --optimize-autoloader --no-interaction
else
php composer.phar install --optimize-autoloader --no-interaction
endif
.PHONY: cc
cc:
php bin/console cache:clear --no-warmup
php bin/console cache:warmup
.PHONY: code-qa
code-qa: lint cs-check phpstan-ci psalm security-check phpmetrics
#code-qa: lint cs-check phpstan-ci psalm phpmd security-check phpmetrics
.PHONY: lint
lint:
bin/console lint:container
bin/console lint:twig templates
bin/console lint:yaml config
.PHONY: cs
cs:
./vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --diff --show-progress=estimating
.PHONY: cs-fix
cs-fix:
./vendor/bin/php-cs-fixer fix --verbose
.PHONY: cs-check
cs-check:
./vendor/bin/php-cs-fixer fix --dry-run --using-cache=no
.PHONY: phpstan
phpstan:
php vendor/bin/phpstan analyse
.PHONY: phpstan-check
phpstan-ci:
php -d memory_limit=1G vendor/bin/phpstan analyse --no-progress
.PHONY: psalm
psalm:
php vendor/bin/psalm
.PHONY: security-check
security-check:
./vendor/bin/security-checker security:check composer.lock
.PHONY: tests
tests: phpunit
.PHONY: phpunit
phpunit:
./vendor/bin/phpunit --coverage-html reports/phpunit-$$(date '+%Y%m%d_%H%M%S')
.PHONY: phpmetrics
phpmetrics:
./vendor/bin/phpmetrics --report-html=reports/phpmetrics-$$(date '+%Y%m%d_%H%M%S').html src
.PHONY: phpmd
phpmd:
./vendor/bin/phpmd src html phpmd.xml --reportfile reports/phpmd-$$(date '+%Y%m%d_%H%M%S').html