|
1 | | -.PHONY: qa |
2 | | -qa: cs tests infection phpstan rector-dry |
| 1 | +.PHONY: $(filter-out vendor,$(MAKECMDGOALS)) |
3 | 2 |
|
4 | | -.PHONY: cs |
5 | | -cs: |
6 | | - vendor/bin/ecs --fix |
| 3 | +help: |
| 4 | + @printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n" |
| 5 | + @grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}' |
7 | 6 |
|
8 | | -.PHONY: infection |
9 | | -infection: |
10 | | - vendor/bin/infection --min-msi=92 |
| 7 | +qa: comp lint stan rector-check tests cs ## Run all relevant code checks |
11 | 8 |
|
12 | | -.PHONY: phpstan |
13 | | -phpstan: |
14 | | - vendor/bin/phpstan analyse |
| 9 | +comp: comp-check comp-norm ## Validate and normalize composer.json |
| 10 | + |
| 11 | +comp-check: ## Validate composer.json |
| 12 | + composer validate |
| 13 | + |
| 14 | +comp-norm: vendor ## Normalize composer.json |
| 15 | + composer normalize |
| 16 | + |
| 17 | +cs: cs-php ## Check and fix coding standards |
| 18 | + |
| 19 | +cs-check: cs-php-check ## Only check coding standards |
| 20 | + |
| 21 | +cs-php: vendor ## Check and fix PHP coding standards |
| 22 | + vendor/bin/ecs check --fix |
| 23 | + |
| 24 | +cs-php-check: vendor ## Only check PHP coding standards |
| 25 | + vendor/bin/ecs check |
15 | 26 |
|
16 | | -.PHONY: rector |
17 | | -rector: |
| 27 | +lint: lint-php |
| 28 | + |
| 29 | +lint-php: ## Lint PHP files |
| 30 | + find . -type f -name '*.php' ! -path "./vendor/*" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) |
| 31 | + |
| 32 | +rector: vendor ## Apply rector rules |
18 | 33 | vendor/bin/rector |
19 | 34 |
|
20 | | -.PHONY: rector-dry |
21 | | -rector-dry: |
| 35 | +rector-check: vendor ## Only check against rector rules |
22 | 36 | vendor/bin/rector --dry-run |
23 | 37 |
|
24 | | -.PHONY: tests |
25 | | -tests: |
| 38 | +stan: vendor ## Run static analysis |
| 39 | + vendor/bin/phpstan analyse |
| 40 | + |
| 41 | +tests: tests-php-unit tests-php-mutation ## Run all tests |
| 42 | + |
| 43 | +tests-php-mutation: vendor ## Run PHP unit tests |
| 44 | + vendor/bin/infection --min-msi=92 |
| 45 | + |
| 46 | +tests-php-unit: vendor ## Run PHP unit tests |
26 | 47 | vendor/bin/phpunit --configuration=phpunit.xml.dist |
| 48 | + |
| 49 | +vendor: composer.json $(wildcard composer.lock) ## Install PHP dependencies |
| 50 | + composer install |
0 commit comments