bernskioldmedia / bm-wp-devtools
Development tools that we use for our WordPress projects.
Installs: 163
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Language:Shell
Requires
- php: ^7.4|^8.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.1
- friendsofphp/php-cs-fixer: ^3.0
- phpcompatibility/phpcompatibility-wp: ^2.1
- phpstan/phpstan: ^0.12.99
- squizlabs/php_codesniffer: ^3.6
- symfony/var-dumper: ^5.2.5
- szepeviktor/phpstan-wordpress: ^0.7.7
- thecodingmachine/phpstan-strict-rules: ^0.12.1
- wp-coding-standards/wpcs: ^2.3
This package is auto-updated.
Last update: 2024-10-26 03:45:44 UTC
README
These are a set of development tools that we use for WordPress development in our plugins and themes.
The tools consists of:
- PHPStan and WordPress rules
- PHPCS ruleset
- PHPCS Fixer
Installation
To use this in your project, require this package as a composer dev-dependency:
composer require bernskioldmedia/bm-wp-devtools --dev
Add the following scripts to your composer.json:
{ "scripts": { "lint": "php-cs-fixer fix -v", "test:cs": "phpcs-wp", "test:types": "phpstan analyse --ansi --memory-limit=-1", "test:lint": "php-cs-fixer fix -v --dry-run", "test": [ "@test:lint", "@test:types" ] } }
Configure PHP Storm
PHPCS Inspections
- go to
Project Settings > PHP > Code Sniffer
and set your phpcs executable. You should use installed in bin-dir. - go to Project
Settings > Inspections > PHP > PHP Code Sniffer validation
and set Custom coding standard. - use path selection ("...") to find the ruleset at
vendor/bernskioldmedia/bm-wp-devtools/phpcs/ruleset.xml