|
22 | 22 | "wyrihaximusnet/php:7.4-zts-alpine3.12-dev" |
23 | 23 | endif |
24 | 24 |
|
25 | | -all: lint cs-fix cs stan composer-require-checker composer-unused unit infection |
| 25 | +all: syntax-php cs-fix cs stan psalm unit infection composer-require-checker composer-unused backward-compatibility-check |
26 | 26 |
|
27 | | -lint: |
| 27 | +syntax-php: ## Lint PHP syntax |
28 | 28 | $(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor . |
29 | 29 |
|
30 | | -cs: |
| 30 | +cs: ## Check the code for code style issues |
31 | 31 | $(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc) |
32 | 32 |
|
33 | | -cs-fix: |
| 33 | +cs-fix: ## Fix any automatically fixable code style issues |
34 | 34 | $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) |
35 | 35 |
|
36 | | -stan: |
| 36 | +stan: ## Run static analysis (PHPStan) |
37 | 37 | $(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon |
38 | 38 |
|
39 | | -psalm: |
| 39 | +psalm: ## Run static analysis (Psalm) |
40 | 40 | $(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats |
41 | 41 |
|
42 | | -unit: |
| 42 | +unit: ## Run tests |
43 | 43 | $(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml |
44 | 44 |
|
45 | 45 | unit-ci: unit |
46 | | - if [ -f ./build/logs/clover.xml ]; then sleep 3; fi |
| 46 | + if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && sleep 3 && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi |
47 | 47 |
|
48 | | -infection: |
| 48 | +infection: ## Run mutation testing |
49 | 49 | $(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc) |
50 | 50 |
|
51 | | -composer-require-checker: |
| 51 | +composer-require-checker: ## Ensure we require every package used in this package directly |
52 | 52 | $(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=composer-require-checker.json |
53 | 53 |
|
54 | | -composer-unused: |
| 54 | +composer-unused: ## Ensure we don't require any package we don't use in this package directly |
55 | 55 | $(DOCKER_RUN) composer unused --ansi |
| 56 | + |
| 57 | +backward-compatibility-check: ## Check code for backwards incompatible changes |
| 58 | + $(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true |
| 59 | + |
| 60 | +task-list-ci: |
| 61 | + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]' |
| 62 | + |
| 63 | +help: |
| 64 | + @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" |
| 65 | + @printf " \033[32m%-32s\033[0m %s\n" "all" "Runs everything" |
| 66 | + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' |
0 commit comments