mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
This switches the installation method for Psalm from Phive to Composer, while still using a Phar file for running Psalm.
Includes:
* Removing Psalm from the Phive configuration.
* Adding Psalm to the Composer configuration. Includes upgrading from version `3.11.2` to version `4.8.1`.
* Adjusting the script used in the `Makefile`.
👉 Please verify and test this as things work differently on different OS-es and this should work for you.
* Adjusting the GH Actions script to use the Composer installed version of Psalm.
Note: due to the committed `composer.lock` file, Psalm will not automatically upgrade when newer versions are available.
Refs:
* https://github.com/vimeo/psalm/releases
* https://github.com/psalm/phar/releases
38 lines
1.2 KiB
Makefile
38 lines
1.2 KiB
Makefile
.PHONY: install-phive
|
|
install-phive:
|
|
mkdir tools; \
|
|
wget -O tools/phive.phar https://phar.io/releases/phive.phar; \
|
|
wget -O tools/phive.phar.asc https://phar.io/releases/phive.phar.asc; \
|
|
gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79; \
|
|
gpg --verify tools/phive.phar.asc tools/phive.phar; \
|
|
chmod +x tools/phive.phar
|
|
|
|
.PHONY: setup
|
|
setup: install-phive
|
|
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phar-ga:latest php tools/phive.phar install --force-accept-unsigned
|
|
|
|
.PHONY: phpcs
|
|
phpcs:
|
|
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -s
|
|
|
|
.PHONY: phpcbf
|
|
phpcbf:
|
|
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest phpcbf
|
|
|
|
.PHONY: phpstan
|
|
phpstan:
|
|
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpstan-ga:latest analyse src --no-progress --configuration phpstan.neon
|
|
|
|
.PHONY: psalm
|
|
psalm:
|
|
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.3 vendor/bin/psalm.phar
|
|
|
|
.PHONY: test
|
|
test:
|
|
docker run -it --rm -v${CURDIR}:/github/workspace phpdoc/phpunit-ga
|
|
docker run -it --rm -v${CURDIR}:/data -w /data php:7.2 -f ./tests/coverage-checker.php 90
|
|
|
|
.PHONY: pre-commit-test
|
|
pre-commit-test: test phpcs phpstan psalm
|
|
|