Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools - refine loading versions from custom binaries #233

Merged
merged 5 commits into from
May 13, 2021

Conversation

zdenekdrahos
Copy link
Member

$ phpqa tools --config tests/.ci/
# tests/.ci/.phpqa.yml
psalm:
    binary: ../../phars/psalm.phar
phpstan:
    binary: ../../phars/phpstan.phar
phpmetrics:
    binary: ../../phars/phpmetrics.phar
phpunit:
    binary: ../../vendor/phpunit/phpunit/phpunit

Before:

+------------------+-----------------------------------------------------------------------------------+---------------------------------------------------+
| Tool             | Version                                                                           | Authors / Info                                    |
+------------------+-----------------------------------------------------------------------------------+---------------------------------------------------+
| phpmetrics       | PhpMetrics, by Jean-François Lépine (https://twitter.com/Halleck45) version v1.10 | "/phpqa/phars/phpmetrics.phar" --version          |
| phpstan          | PHPStan - PHP Static Analysis Tool 0.12.86                                        | "/phpqa/phars/phpstan.phar" --version             |
| phpunit          | 4.8.36                                                                            | "/phpqa/vendor/phpunit/phpunit/phpunit" --version |
| psalm            | Psalm 4.x-dev@                                                                    | "/phpqa/phars/psalm.phar" --version               |
+------------------+-----------------------------------------------------------------------------------+---------------------------------------------------+

After:

+------------------+---------------+---------------------------------------------------+
| Tool             | Version       | Authors / Info                                    |
+------------------+---------------+---------------------------------------------------+
| phpmetrics       | 1.10          | "/phpqa/phars/phpmetrics.phar" --version          |
| phpstan          | 0.12.86       | "/phpqa/phars/phpstan.phar" --version             |
| phpunit          | 4.8.36        | "/phpqa/vendor/phpunit/phpunit/phpunit" --version |
| psalm            | 4.x           | "/phpqa/phars/psalm.phar" --version               |
+------------------+---------------+---------------------------------------------------+

extractVersion worked only for phpunit, but every tool can define custom binary (e.g. phar)
$ chmod -x phars/*.phar
$ phpqa tools --config tests/.ci/
+------------------+------------------------------------------------------------------+----------------------------------------------------------------+
| Tool             | Version                                                          | Authors / Info                                                 |
+------------------+------------------------------------------------------------------+----------------------------------------------------------------+
| phpmetrics       | sh: /phpqa/phars/phpmetrics.phar: Permission denied | "/phpqa/phars/phpmetrics.phar" --version          |
| psalm            | sh: /phpqa/phars/psalm.phar: Permission denied      | "/phpqa/phars/psalm.phar" --version               |
@zdenekdrahos zdenekdrahos merged commit 8ca3804 into master May 13, 2021
@zdenekdrahos zdenekdrahos deleted the versions-from-custom-binaries branch May 13, 2021 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant