Skip to content
Open
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/compiler/vendor
/conf/config.local.yml
/build-cs
/build-infection
/infection.json5
/infection.phar
/vendor
/.idea/*
!.idea/icon.png
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,23 @@ name-collision:

composer-dependency-analyser:
php vendor/bin/composer-dependency-analyser --config build/composer-dependency-analyser.php

.PHONY: infection
infection:
git -C build-infection pull || git clone https://github.com/phpstan/build-infection.git
git -C build-infection fetch origin && git -C build-infection reset --hard origin/1.x
composer install --working-dir build-infection --no-interaction --no-progress
php build-infection/bin/infection-config.php --source-directory='build/PHPStan/Build'> infection.json5
XDEBUG_MODE=coverage php tests/vendor/bin/paratest \
--coverage-xml=tmp/coverage/coverage-xml \
--log-junit=tmp/coverage/junit.xml
version=$(shell jq -r '.packages[] | select(.name == "infection/infection") | .version' build-infection/composer.lock); \
wget https://github.com/infection/infection/releases/download/$$version/infection.phar --timestamping;
php infection.phar \
--configuration=infection.json5 \
--git-diff-base=origin/2.1.x \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My makefile fu is not strong enough to turn this hardcoded 2.1.x version into a variable filled from a git command determining the default target automatically

--git-diff-lines \
--coverage=tmp/coverage \
--skip-initial-tests \
--ignore-msi-with-no-mutations \
--logger-text=php://stdout;
Loading