Skip to content

Commit

Permalink
Merge pull request #35 from alleyinteractive/2.x
Browse files Browse the repository at this point in the history
[Version 2]: Upgrading to WPCS/VIPCS 3.0
  • Loading branch information
srtfisher authored Sep 8, 2023
2 parents 7b449f3 + 9e914d3 commit 0c57c43
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
22 changes: 14 additions & 8 deletions Alley-Interactive/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
<!-- Use the WordPress ruleset, with some customizations. -->
<rule ref="WordPress">
<!-- Allow short array syntax. -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="Universal.Arrays.DisallowShortArraySyntax" />
<!-- Allow short ternary expressions -->
<exclude name="WordPress.PHP.DisallowShortTernary" />
<exclude name="Universal.Operators.DisallowShortTernary.Found" />
<!-- Allow any name to be used as a function paramater name. -->
<exclude name="Universal.NamingConventions.NoReservedKeywordParameterNames" />
<!-- Allow post-increment/decrement vs disallowing it. -->
<exclude name="Universal.Operators.DisallowStandalonePostIncrementDecrement" />
<!-- Allow checking any capability. -->
<exclude name="WordPress.WP.Capabilities.Undetermined" />
<exclude name="WordPress.WP.Capabilities.Unknown" />
</rule>

<!-- Use the VIP Go ruleset. -->
Expand All @@ -24,12 +31,6 @@
<!-- Check for cross-version support for PHP 8.0 and higher. -->
<config name="testVersion" value="8.0-"/>

<!--
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
-->
<ini name="error_reporting" value="E_ALL &#38; ~E_DEPRECATED" />

<!--
Alley specific customizations.
-->
Expand Down Expand Up @@ -76,4 +77,9 @@
-->
<type>error</type>
</rule>

<!-- Ignore an issue with singleton classes instance methods being flagged. -->
<rule ref="Universal.CodeAnalysis.ConstructorDestructorReturn.ReturnValueFound">
<exclude-pattern>(class|trait)-(instance|singleton).php</exclude-pattern>
</rule>
</ruleset>
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ You can create a custom ruleset for your project that extends or customizes thes

This project adheres to [Keep a CHANGELOG](https://keepachangelog.com/en/1.0.0/).

### 2.0.0

- **Breaking Change:** Upgraded to `automattic/vipwpcs` and
`wp-coding-standards/wpcs` to 3.0. See [Upgrading to 2.0](https://github.com/alleyinteractive/alley-coding-standards/wiki/Upgrading-to-2.0)
for more details.

### 1.0.1

- Ignore deprecation errors in WPCS to allow it work with PHP 8.0+.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"keywords": [ "phpcs", "static analysis" ],
"license": "GPL-2.0-or-later",
"require": {
"automattic/vipwpcs": "^2.3.4",
"automattic/vipwpcs": "^3.0",
"phpcompatibility/phpcompatibility-wp": "^2.1.4"
},
"config": {
Expand Down

0 comments on commit 0c57c43

Please sign in to comment.