-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
51 lines (37 loc) · 1.76 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
# See https://tech.davis-hansson.com/p/make/
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.DEFAULT_GOAL := help
.PHONY: help
help:
@printf "\033[33mUsage:\033[0m\n make TARGET\n\033[33m\nAvailable Commands:\n\033[0m"
@grep -E '^[a-zA-Z-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " [32m%-32s[0m %s\n", $$1, $$2}'
KNOWN_TARGETS = infection
ARGS := $(filter-out $(KNOWN_TARGETS),$(MAKECMDGOALS))
.DEFAULT: ;: do nothing
#
# Variables
#---------------------------------------------------------------------------
PHP_CS_FIXER=vendor/bin/php-cs-fixer fix
PHP_CS_FIXER_ARGS=--verbose --config=.php-cs-fixer.dist.php --allow-risky=yes --diff --show-progress=dots
# Psalm
PSALM=vendor/bin/psalm
DISABLE_XDEBUG=XDEBUG_MODE=off
#
# Commands (phony targets)
#---------------------------------------------------------------------------
analyze: ## Runs analyze tools (Static Analysis tools, Unit and Functional tests and etc)
analyze: cs-check validate-composer tests infection
cs-check: prerequisites ## Runs code style checks in dry-run mode
$(DISABLE_XDEBUG) $(PHP_CS_FIXER) $(PHP_CS_FIXER_ARGS) --dry-run
cs-fix: prerequisites ## Runs code style checks and fix founded issues
$(DISABLE_XDEBUG) $(PHP_CS_FIXER) $(PHP_CS_FIXER_ARGS)
validate-composer: prerequisites ## Runs Composer Validate
$(DISABLE_XDEBUG) composer validate --strict --check-lock
tests: prerequisites ## Runs tests
$(DISABLE_XDEBUG) vendor/bin/phpunit
infection: prerequisites ## Runs Infection (Mutation Testing tool)
$(DISABLE_XDEBUG) vendor/bin/infection --threads=max --only-covered --show-mutations --min-covered-msi=100
# We need both vendor/autoload.php and composer.lock being up to date
.PHONY: prerequisites
prerequisites: vendor/autoload.php composer.lock