Skip to content

Commit

Permalink
Pin versions and run psalm too
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Jul 14, 2020
1 parent 7da90f2 commit f24e406
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/phpstan.neon.dist export-ignore
/phpstan.tests.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/README.md export-ignore
/UPGRADING.md export-ignore
/vendor-bin export-ignore
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ We accept contributions via pull requests on Github. Please review these guideli
First, install the dependencies using [Composer](https://getcomposer.org/):

```bash
$ composer install
$ make install
```

Then run [PHPUnit](https://phpunit.de/):
Then run [PHPUnit](https://phpunit.de/) and the static analyzers:

```bash
$ vendor/bin/phpunit
$ make test
```

The tests will be automatically run by [Travis CI](https://travis-ci.org/) and [GitHub Actions](https://github.com/features/actions) against pull requests.
These will also be automatically run by [Travis CI](https://travis-ci.org/) and [GitHub Actions](https://github.com/features/actions) against pull requests.
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
install:
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base update
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base bin all update

phpunit:
@rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:7.4-cli

phpstan-analyze-src:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze src -c phpstan.src.neon.dist

phpstan-analyze-tests:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze tests -c phpstan.tests.neon.dist

psalm-analyze:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm --rm registry.gitlab.com/grahamcampbell/php:7.4-cli

psalm-show-info:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true

test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze

clean:
@rm -rf .phpunit.result.cache composer.lock vendor vendor-bin/*/composer.lock vendor-bin/*/vendor
12 changes: 12 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<psalm
errorLevel="4"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
</projectFiles>
</psalm>
13 changes: 8 additions & 5 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"require": {
"phpstan/phpstan": "^0.12.25",
"phpstan/extension-installer": "^1.0.4",
"phpstan/phpstan-deprecation-rules": "^0.12.4",
"phpstan/phpstan-strict-rules": "^0.12.2",
"thecodingmachine/phpstan-strict-rules": "^0.12.0"
"phpstan/phpstan": "~0.12.32",
"phpstan/extension-installer": "~1.0.4",
"phpstan/phpstan-deprecation-rules": "~0.12.4",
"phpstan/phpstan-strict-rules": "~0.12.2",
"thecodingmachine/phpstan-strict-rules": "~0.12.0"
},
"config": {
"preferred-install": "dist"
}
}
8 changes: 8 additions & 0 deletions vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"vimeo/psalm": "~3.12.2"
},
"config": {
"preferred-install": "dist"
}
}

0 comments on commit f24e406

Please sign in to comment.