-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (32 loc) · 1.24 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
.DEFAULT_GOAL := help
.RUN_PHP := php
.PHONY: all $(MAKECMDGOALS) #see https://stackoverflow.com/questions/44492805/makefile-declare-all-targets-phony
ifneq ("$(wildcard .docker)","")
include Makefile_Docker
endif
test: phpunit ## Run the test suite
qa: validate-composer phpstan cs lint ## Run the quality assurance suite
enable-docker: ## Enable Docker commands
@touch .docker
disable-docker: ## Disable Docker commands
@rm -f .docker
dependencies:
$(.RUN_PHP) composer install --no-interaction --no-scripts --ansi
phpunit:
$(.RUN_PHP) bin/phpunit
validate-composer:
$(.RUN_PHP) composer validate --strict
lint: lint-container lint-yaml
lint-container:
$(.RUN_PHP) bin/console lint:container
lint-yaml:
$(.RUN_PHP) bin/console lint:yaml config --parse-tags
phpstan:
$(.RUN_PHP) vendor/bin/phpstan analyse --no-progress
cs:
$(.RUN_PHP) vendor/bin/php-cs-fixer fix --diff --dry-run --ansi
cs-fix:
$(.RUN_PHP) vendor/bin/php-cs-fixer fix --diff --ansi
# Based on https://www.thapaliya.com/en/writings/well-documented-makefiles/
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)