Pre-commit hook for WordPress projects.
This package will install PHPCS with the WordPress Coding Standard definitions together with a git pre-commit hook script that will run PHP linting and the PHPCS whenever you do a commit to your project.
If your project has a
phpcs.xml.dist file available, the pre-commit hook will use this file as a ruleset definition. Otherwise the “WordPress” ruleset will be used.
composer require bjornjohansen/wp-pre-commit-hook --dev
Or manually add
"bjornjohansen/wp-pre-commit-hook": "*" to the
require-dev section in your
Then do a