Skip to content

Commit

Permalink
Merge pull request #455 from ergebnis/fix/phpstan
Browse files Browse the repository at this point in the history
Fix: Remove `phpstan/phpstan`
  • Loading branch information
localheinz authored Dec 30, 2021
2 parents 7919625 + a369ce5 commit 5ded592
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 352 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ trim_trailing_whitespace = true
[*.json]
indent_size = 2

[*.neon]
indent_style = tab

[*.{yaml,yml}]
indent_size = 2

Expand Down
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 @@ -169,19 +169,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
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,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 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 analyze --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
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,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.0.0",
"infection/infection": "~0.15.3",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "~0.12.99",
"phpstan/phpstan-deprecation-rules": "~0.12.6",
"phpstan/phpstan-strict-rules": "~0.12.11",
"phpunit/phpunit": "^8.5.22",
"psalm/plugin-phpunit": "~0.16.1",
"vimeo/psalm": "^4.13.1",
Expand All @@ -41,8 +36,7 @@
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
"ergebnis/composer-normalize": true
},
"platform": {
"php": "7.2.33"
Expand Down
Loading

0 comments on commit 5ded592

Please sign in to comment.