Skip to content

Commit

Permalink
chore: configure PHPStan static analysis (#87)
Browse files Browse the repository at this point in the history
* chore: configure PHPStan static analysis

* chore: exclude `/phpstan/` from CS ruleset

---------

Co-authored-by: John Parris <john.parris@wpengine.com>
  • Loading branch information
justlevine and mindctrl authored May 23, 2023
1 parent b075a98 commit 91a0b48
Show file tree
Hide file tree
Showing 6 changed files with 380 additions and 5 deletions.
1 change: 1 addition & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Exclude composer vendor directory -->
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/phpstan/</exclude-pattern>
<exclude-pattern>/tests/</exclude-pattern>

<!-- How to scan -->
Expand Down
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@
"phpunit/phpunit": "^9.5",
"wpengine/wpengine-coding-standards": "dev-develop",
"yoast/phpunit-polyfills": "^1.0",
"squizlabs/php_codesniffer": "^3.7"
"squizlabs/php_codesniffer": "^3.7",
"phpstan/phpstan": "^1.10",
"phpstan/extension-installer": "^1.3",
"szepeviktor/phpstan-wordpress": "^1.3",
"axepress/wp-graphql-stubs": "^1.14"
},
"scripts": {
"lint": "parallel-lint -e php --no-colors --exclude vendor .",
"phpcs": "phpcs",
"phpcs:fix": "phpcbf",
"phpstan": "phpstan analyze --ansi --memory-limit=1G",
"suite": [
"@lint",
"@phpcs",
Expand All @@ -29,7 +34,8 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
},
"platform": {
"php": "7.4"
Expand Down
Loading

0 comments on commit 91a0b48

Please sign in to comment.