-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# 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 to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/). | ||
|
||
This is a [PHP Composter](https://github.com/php-composter/php-composter) Action. | ||
|
||
Uses the wonderful [PHP CodeSniffer Project](https://github.com/squizlabs/PHP_CodeSniffer). | ||
|
||
## Table Of Contents | ||
|
||
* [Installation](#installation) | ||
* [Basic Usage](#basic-usage) | ||
* [Contributing](#contributing) | ||
|
||
## Installation | ||
|
||
Add the repository's URL as a repository to the `composer.json` file: | ||
``` | ||
"repositories": [ | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/php-composter/php-composter-phpcs-wpcs" | ||
} | ||
], | ||
``` | ||
|
||
Then j add as a development requirement to your `composer.json`, and it should work automagically: | ||
|
||
```BASH | ||
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. | ||
|
||
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. |