Skip to content

Commit

Permalink
Merge pull request #327 from ergebnis/fix/phpstan
Browse files Browse the repository at this point in the history
Fix: Remove `phpstan/phpstan`
  • Loading branch information
localheinz authored Nov 27, 2021
2 parents 9f28059 + 22d494c commit 7a38b39
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 490 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
/composer-require-checker.json 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
Original file line number Diff line number Diff line change
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://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) 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
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,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.7"
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 analyse --configuration=phpstan.neon --memory-limit=-1"

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

Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ mutation-tests: vendor ## Runs mutation tests with infection/infection
vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${MIN_COVERED_MSI} --min-msi=${MIN_MSI}

.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 analyse --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
vendor/bin/phpstan analyze --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon --memory-limit=-1
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
7 changes: 0 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,8 @@
"ergebnis/composer-normalize": "^2.16.0",
"ergebnis/license": "^1.1.0",
"ergebnis/php-cs-fixer-config": "^2.14.0",
"ergebnis/phpstan-rules": "~0.15.3",
"ergebnis/test-util": "^1.5.0",
"infection/infection": "~0.15.3",
"jangregor/phpstan-prophecy": "~0.8.1",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "~0.12.99",
"phpstan/phpstan-deprecation-rules": "~0.12.6",
"phpstan/phpstan-phpunit": "~0.12.22",
"phpstan/phpstan-strict-rules": "~0.12.11",
"phpunit/phpunit": "^8.5.21",
"psalm/plugin-phpunit": "~0.16.1",
"vimeo/psalm": "^4.13.1"
Expand Down
Loading

0 comments on commit 7a38b39

Please sign in to comment.