Skip to content

Commit

Permalink
Merge pull request #34 from alleyinteractive/wpcs-3-0
Browse files Browse the repository at this point in the history
Ignore deprecation error in WPCS until 3.0 is ready to be used
  • Loading branch information
srtfisher authored Aug 29, 2023
2 parents c566318 + df96949 commit 7b449f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 44 deletions.
6 changes: 6 additions & 0 deletions Alley-Interactive/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
<!-- 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
47 changes: 4 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,53 +64,14 @@ You can create a custom ruleset for your project that extends or customizes thes
</ruleset>
```

## Using Alley Coding Standards on PHP 8.1

If you plan on using this ruleset on PHP 8.1, you will need to make some
modifications to your Composer configuration. For some context, the current
version of this ruleset requires `wp-coding-standards/wpcs` 2.3. This package is
not compatible with PHP 8.1 and runs into some issues when being used. Until
`wp-coding-standards/wpcs` 3.0 is released we can use a forked version of the
package that is compatible with PHP 8.1.

### 1. Add the Repository

Add the Composer repository to your project's `composer.json` file:

```json
{
"repositories": {
"wpcs": {
"type": "vcs",
"url": "https://github.com/alleyinteractive/WordPress-Coding-Standards"
}
}
}
```

### 2. Switch to the Forked Version

Add the following to your `composer.json` file `autoload-dev` section:

```json
{
"require-dev": {
"alleyinteractive/alley-coding-standards": "^1.0",
"wp-coding-standards/wpcs": "dev-php-8-1 as 2.3.x-dev"
},
}
```

### 3. Run `composer update`

If you run into any problems, please open an issue. After
`wp-coding-standards/wpcs` 3.0 is released we will remove the above fork from
our projects and rely on the official release.

## Change Log

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

### 1.0.1

- Ignore deprecation errors in WPCS to allow it work with PHP 8.0+.

### 1.0.0

- No changes, tagging a stable release of Alley Coding Standards.
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.3",
"automattic/vipwpcs": "^2.3.4",
"phpcompatibility/phpcompatibility-wp": "^2.1.4"
},
"config": {
Expand Down

0 comments on commit 7b449f3

Please sign in to comment.