PHPCS Diff
Add WP-CLI command for generating PHP CodeSniffer reports for diff retrieved from version systems
★ 8stars
6forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/automattic/phpcs-diff/archive/refs/heads/master.zipFrom the readme
PHPCS Diff
The purpose of this project is to provide a mean of running PHP CodeSniffer (aka PHPCS) checks on top of file(s) stored in a version control system and reporting issues introduced only in specific revision(s).
Reporting only new issues for specific revision migth be important in case the PHPCS is being introduced later in the development cycle and there are no resources for cleaning up all existing issues.
Installation
Pre-requisities
Along a working WordPress installation you'll need a WP CLI installed since you can interact with the plugin via WP CLI only for now.
You also will need to have the PHP CodeSniffer installed on your server.
Installation steps for this project
Checkout this repository to your plugins directory and activate the plugin via standard WordPress administration.
Configuration
In order to be able to properly use this plugin you'll have to add some constants to your wp-config.php file.
PHPCS
If default values for running PHPCS command does not match your environment (see https://github.com/Automattic/phpcs-diff/blob/master/class-phpcs-diff.php#L5 ), you need to override those via constants located in wp-config.php of your WordPress instal