Check your PHP source code for WPCS compliance before committing.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
CHANGELOG.md
README.md
composer.json
composer.lock

README.md

PHP Composter PHPCS WPCS

Check your PHP source code for compliance with WordPress Coding Standards before committing.

This Composer package will start to check your PHP files upon each commit to make sure they comply with the WordPress Coding Standards.

This is a PHP Composter Action.

Uses the wonderful PHP CodeSniffer Project.

Table Of Contents

Installation

Add the GitHub repository's URL as a package repository to the composer.json file:

"repositories": [
  {
    "type": "vcs",
    "url": "https://github.com/php-composter/php-composter-phpcs-wpcs"
  }
],

Then just add the package as a development requirement to your composer.json, and it should work automagically:

composer require --dev php-composter/php-composter-phpcs-wpcs

Basic Usage

It should just work when you git commit.

Internals

By default, of the 5 different WordPress coding standards (WordPress-VIP, WordPress, WordPress-Extra, WordPress-Docs and WordPress-Core), this one uses the WordPress-Extra one.

If you need to change it, currently you need to edit the Sniff file. Contributions on how to make this dynamic are welcome (.env file, different sniffs for each and choosing the appropriate hooks).

Contributing

All feedback / bug reports / pull requests are welcome.