Skip to content

Commit

Permalink
Merge pull request #778 from ergebnis/fix/phpstan
Browse files Browse the repository at this point in the history
Fix: Remove `phpstan/phpstan`
  • Loading branch information
localheinz committed Sep 5, 2021
2 parents cc5374b + bfe6387 commit f1ff4b4
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 398 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Expand Up @@ -9,7 +9,5 @@
/composer.lock export-ignore
/infection.json export-ignore
/Makefile export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Expand Up @@ -49,7 +49,7 @@ to run a dependency analysis.

## Static Code Analysis

We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.
We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.

Run

Expand All @@ -59,17 +59,17 @@ $ make static-code-analysis

to run a static code analysis.

We are also using the baseline features of [`phpstan/phpstan`](https://phpstan.org/user-guide/baseline) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
We are also using the baseline feature of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).

Run

```sh
$ make static-code-analysis-baseline
```

to regenerate the baselines in [`../phpstan-baseline.neon`](../phpstan-baseline.neon) and [`../psalm-baseline.xml`](../psalm-baseline.xml).
to regenerate the baseline in [`../psalm-baseline.xml`](../psalm-baseline.xml).

:exclamation: Ideally, the baselines should shrink over time.
:exclamation: Ideally, the baseline should shrink over time.

## Tests

Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/integrate.yaml
Expand Up @@ -250,19 +250,6 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Create cache directory for phpstan/phpstan"
run: "mkdir -p .build/phpstan"

- name: "Cache cache directory for phpstan/phpstan"
uses: "actions/cache@v2.1.6"
with:
path: ".build/phpstan"
key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-phpstan-"

- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1"

- name: "Create cache directory for vimeo/psalm"
run: "mkdir -p .build/psalm"

Expand Down
9 changes: 2 additions & 7 deletions Makefile
Expand Up @@ -27,17 +27,12 @@ mutation-tests: vendor ## Runs mutation tests with infection/infection
vendor/bin/infection --configuration=infection.json

.PHONY: static-code-analysis
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan and vimeo/psalm
mkdir -p .build/phpstan
vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1
static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm
mkdir -p .build/psalm
vendor/bin/psalm --config=psalm.xml --diff --show-info=false --stats --threads=4

.PHONY: static-code-analysis-baseline
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan and vimeo/psalm
mkdir -p .build/phpstan
echo '' > phpstan-baseline.neon
vendor/bin/phpstan --configuration=phpstan.neon --error-format=baselineNeon --memory-limit=-1 > phpstan-baseline.neon || true
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with vimeo/psalm
mkdir -p .build/psalm
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml

Expand Down
6 changes: 0 additions & 6 deletions composer.json
Expand Up @@ -17,14 +17,8 @@
"ergebnis/composer-normalize": "^2.15.0",
"ergebnis/license": "^1.1.0",
"ergebnis/php-cs-fixer-config": "^3.1.0",
"ergebnis/phpstan-rules": "~0.15.3",
"ergebnis/test-util": "^1.5.0",
"infection/infection": "~0.24.0",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "~0.12.98",
"phpstan/phpstan-deprecation-rules": "~0.12.6",
"phpstan/phpstan-phpunit": "~0.12.22",
"phpstan/phpstan-strict-rules": "~0.12.11",
"phpunit/phpunit": "~9.5.9",
"psalm/plugin-phpunit": "~0.16.1",
"vimeo/psalm": "^4.9.3"
Expand Down

0 comments on commit f1ff4b4

Please sign in to comment.