Skip to content

Commit

Permalink
Build/PHPCS: use PHPCompatibilityWP and minor ruleset tweak (#4)
Browse files Browse the repository at this point in the history
* Build/PHPCS: use PHPCompatibilityWP

This PR:
* Switches the repo over to use `PHPCompatibilityWP` rather than `PHPCompatibility`.
    As this repo and ruleset appears to be aimed at WordPress projects, using the `PHPCompatibilityWP` ruleset is the better choice to prevent false positives for PHP functions and constants which are back-filled by WP.
* Switches the dependency over to use the repo in the `PHPCompatibility` organisation rather than the one in `wimg`'s personal account.

### References:
* https://github.com/PHPCompatibility/PHPCompatibilityWP
* PHPCompatibility/PHPCompatibility#688
* https://github.com/PHPCompatibility/PHPCompatibility/releases/tag/8.2.0

* PHPCS Ruleset: minor fix

Properties belong to individual sniffs, not to standards. The way the property was set, it was going to be ignored. This minor changes fixes that.
  • Loading branch information
jrfnl authored and stian-overasen committed Sep 7, 2018
1 parent 9878893 commit 775aa10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Dekode/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<exclude-pattern>*/node_modules/*</exclude-pattern>

<!-- Rules -->
<rule ref="WordPress">
<rule ref="WordPress"/>
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="/" />
<property name="additionalWordDelimiters" value="/"/>
</properties>
</rule>
<rule ref="PHPCompatibility" />
<rule ref="PHPCompatibilityWP" />
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found" />
<rule ref="NeutronStandard.StrictTypes.RequireStrictTypes.StrictTypes" />
<rule ref="NeutronStandard.Functions.TypeHint.NoReturnType" />
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "phpcodesniffer-standard",
"require": {
"wp-coding-standards/wpcs": "^1.0",
"wimg/php-compatibility": "^8.2",
"phpcompatibility/phpcompatibility-wp": "^1.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"automattic/phpcs-neutron-standard": "^1.5"
},
Expand Down

0 comments on commit 775aa10

Please sign in to comment.