|
| 1 | + |
| 2 | +SHELL:=/bin/bash |
| 3 | +.DEFAULT_GOAL:=help |
| 4 | +.PHONY: help install up code-sniff code-format code-find-bugs code-find-bugs code-find-smells |
| 5 | +PHP_CONTAINER_NAME=php |
| 6 | + |
| 7 | +help: ## Display this help |
| 8 | + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) |
| 9 | + |
| 10 | + |
| 11 | +install: composer-install up ## Install required software and initialize your local configuration |
| 12 | + |
| 13 | +up: ## Start application containers and required services |
| 14 | + @docker-compose up -d |
| 15 | + |
| 16 | +down: ## Stop application containers and required services |
| 17 | + @docker-compose down |
| 18 | + |
| 19 | +console: ## Execute php container console |
| 20 | + @docker exec -it ${PHP_CONTAINER_NAME} bash |
| 21 | + |
| 22 | +test: ## Execute all phpunit test |
| 23 | + @docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpunit |
| 24 | + |
| 25 | +code-sniff cs: ## Detect coding standard violations in all project files using code sniffer |
| 26 | + @docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpcs |
| 27 | + |
| 28 | +code-format cf: ## Fix coding standard violations in all project files |
| 29 | + @docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpcbf |
| 30 | + |
| 31 | +code-find-bugs phpstan: ## Run static analysis tool to find possible bugs using phpstan |
| 32 | + @docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpstan analyse |
| 33 | + |
| 34 | +code-find-smells md: ## Run static analysis tool to find code smells using mess detector |
| 35 | + @docker-compose exec ${PHP_CONTAINER_NAME} ./vendor/bin/phpmd src,tests text phpmd.xml --suffixes php --exclude src/Infrastructure/Persistence/Doctrine/Migrations,tests/_support,tests/acceptance |
| 36 | + |
| 37 | +composer-update: ## Run composer update |
| 38 | + @docker run --rm --interactive --tty --volume $PWD:/app composer update |
| 39 | + |
| 40 | +composer-install: ## Run composer update |
| 41 | + @docker run --rm --interactive --tty --volume $PWD:/app composer install |
| 42 | + |
| 43 | + |
0 commit comments