Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruleset: add the PHPCompatibilityWP standard #177

Merged
merged 1 commit into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The WPThemeReview Standard requires:
* PHP 5.4 or higher.
* [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **3.3.0** or higher.
* [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) version **1.0.0** or higher.
* [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) version **1.0.0** or higher.


## Installation
Expand Down Expand Up @@ -86,7 +87,7 @@ $ vendor/bin/phpcs -i

If everything went well, the output should look something like this:
```
The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra, WordPress-VIP and WPThemeReview
The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, PHPCompatibility, PHPCompatibilityWP, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra, WordPress-VIP and WPThemeReview
```


Expand Down
4 changes: 4 additions & 0 deletions WPThemeReview/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<!-- Treat all files as UTF-8. -->
<config name="encoding" value="utf-8"/>

<!-- Themes should be compatible with PHP 5.2 and higher. -->
<config name="testVersion" value="5.2-"/>
<rule ref="PHPCompatibilityWP"/>

<!-- No PHP short open tags allowed. -->
<!-- Covers: https://github.com/Otto42/theme-check/blob/master/checks/phpshort.php -->
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"require" : {
"php" : ">=5.4",
"squizlabs/php_codesniffer": "^3.3.0",
"wp-coding-standards/wpcs" : "^1.0.0"
"wp-coding-standards/wpcs" : "^1.0.0",
"phpcompatibility/phpcompatibility-wp": "^1.0"
},
"require-dev": {
"phpunit/phpunit" : "^4.0 || ^5.0 || ^6.0 || ^7.0",
Expand All @@ -50,8 +51,8 @@
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
},
"scripts" : {
"install-standards" : "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths ../../..,../../wp-coding-standards/wpcs",
"install-standards-dev": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths ../../..,../../wp-coding-standards/wpcs,../../phpcompatibility/php-compatibility",
"install-standards" : "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths ../../..,../../wp-coding-standards/wpcs,../../phpcompatibility/phpcompatibility-wp",
"install-standards-dev": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths ../../..,../../wp-coding-standards/wpcs,../../phpcompatibility/phpcompatibility-wp,../../phpcompatibility/php-compatibility",
"run-tests" : "@php ./vendor/phpunit/phpunit/phpunit --filter WPThemeReview ./vendor/squizlabs/php_codesniffer/tests/AllTests.php",
"phpcs-i" : "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs -i",
"check-cs" : "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
Expand Down