Skip to content

Commit

Permalink
Update to wp-coding-standards/wpcs:^2.1; Ditch automattic/vipwpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrufus committed Jul 11, 2019
1 parent c05dded commit b3862fb
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 114 deletions.
5 changes: 0 additions & 5 deletions Itineris/ruleset.xml
Expand Up @@ -3,13 +3,8 @@
<description>Itineris WordPress Coding Standards</description>

<rule ref="PSR2"/>

<rule ref="PSR12"/>

<rule ref="WordPressVIPMinimum">
<exclude name="WordPressVIPMinimum.VIP.RestrictedFunctions.wp_remote_get_wp_remote_get"/>
</rule>

<rule ref="WordPress">
<exclude name="Generic.Classes.OpeningBraceSameLine.BraceOnNewLine"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
Expand Down
27 changes: 13 additions & 14 deletions README.md
Expand Up @@ -30,7 +30,7 @@

[Itineris WP Coding Standards](https://github.com/ItinerisLtd/itineris-wp-coding-standards) is a project with rulesets for code style and quality tools to be used in Itineris WordPress projects.

It is a mix with [PSR-1](https://www.php-fig.org/psr/psr-1/), [PSR-2](https://www.php-fig.org/psr/psr-2), [PSR-4](https://www.php-fig.org/psr/psr-4/), [PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md), [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) and [Automattic/VIP-Coding-Standards](https://github.com/Automattic/VIP-Coding-Standards).
It is a mix with [PSR-1](https://www.php-fig.org/psr/psr-1/), [PSR-2](https://www.php-fig.org/psr/psr-2), [PSR-4](https://www.php-fig.org/psr/psr-4/), [PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md) and [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards).

Whenever there's a conflict between PSR and WPCS, always prefer PSR.

Expand Down Expand Up @@ -63,7 +63,7 @@ First, create [`phpcs.xml`](https://github.com/squizlabs/PHP_CodeSniffer/wiki/An
<arg name="extensions" value="php"/>

<!-- Install custom rulesets -->
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs,vendor/automattic/vipwpcs,vendor/itinerisltd/itineris-wp-coding-standards"/>
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs,vendor/itinerisltd/itineris-wp-coding-standards"/>

<!-- Use Itineris WP Coding Standards -->
<rule ref="Itineris"/>
Expand All @@ -77,18 +77,18 @@ First, create [`phpcs.xml`](https://github.com/squizlabs/PHP_CodeSniffer/wiki/An
<exclude-pattern>/vendor/*</exclude-pattern>

<!-- TODO: Define minimum supported WordPress version -->
<config name="minimum_supported_wp_version" value="4.9"/>
<config name="minimum_supported_wp_version" value="5.2"/>

<!-- TODO: Define expected text domains -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="wc-worldpay,woocommerce"/>
<property name="text_domain" type="array" value="my-plugin,my-theme,woocommerce,sage"/>
</properties>
</rule>
</ruleset>
```

Then, define a composer script:
Then, define [composer scripts](https://getcomposer.org/doc/articles/scripts.md):

```json
# composer.json
Expand Down Expand Up @@ -119,27 +119,27 @@ $ composer style:fix

### Will you add support for older PHP versions?

Never! This plugin will only works on [actively supported PHP versions](https://secure.php.net/supported-versions.php).
Never! This plugin will only work on [actively supported PHP versions](https://secure.php.net/supported-versions.php).

Don't use it on **end of life** or **security fixes only** PHP versions.

### It looks awesome. Where can I find some more goodies like this?

- Articles on [Itineris' blog](https://www.itineris.co.uk/blog/)
- More projects on [Itineris' GitHub profile](https://github.com/itinerisltd)
- More plugins on [Itineris' wp.org profile](https://profiles.wordpress.org/itinerisltd/#content-plugins)
- More plugins on [Itineris](https://profiles.wordpress.org/itinerisltd/#content-plugins) and [TangRufus](https://profiles.wordpress.org/tangrufus/#content-plugins) wp.org profiles
- Follow [@itineris_ltd](https://twitter.com/itineris_ltd) and [@TangRufus](https://twitter.com/tangrufus) on Twitter
- Hire [Itineris](https://www.itineris.co.uk/services/) to build your next awesome site

### This isn't on wp.org. Where can I give a ⭐️⭐️⭐️⭐️⭐️ review?
### This isn't on wp.org. Where can I give a :star::star::star::star::star: review?

Thanks! Glad you like it. It's important to let my boss knows somebody is using this project. Instead of giving reviews on wp.org, consider:
Thanks! Glad you like it. It's important to let my boss knows somebody is using this project. Please consider:

- tweet something good with mentioning [@itineris_ltd](https://twitter.com/itineris_ltd) and [@TangRufus](https://twitter.com/tangrufus)
- star this [Github repo](https://github.com/ItinerisLtd/itineris-wp-coding-standards)
- watch this [Github repo](https://github.com/ItinerisLtd/itineris-wp-coding-standards)
- :star: star this [Github repo](https://github.com/ItinerisLtd/itineris-wp-coding-standards)
- :eyes: watch this [Github repo](https://github.com/ItinerisLtd/itineris-wp-coding-standards)
- write blog posts
- submit pull requests
- submit [pull requests](https://github.com/ItinerisLtd/itineris-wp-coding-standards)
- [hire Itineris](https://www.itineris.co.uk/services/)

## Feedback
Expand All @@ -164,5 +164,4 @@ Full list of contributors can be found [here](https://github.com/ItinerisLtd/iti

## License

[Itineris WP Coding Standards](https://github.com/ItinerisLtd/itineris-wp-coding-standards) is licensed under the [MIT License](https://opensource.org/licenses/MIT).
Please see [License File](./LICENSE) for more information.
[Itineris WP Coding Standards](https://github.com/ItinerisLtd/itineris-wp-coding-standards) is released under the [MIT License](https://opensource.org/licenses/MIT).
7 changes: 3 additions & 4 deletions composer.json
Expand Up @@ -25,9 +25,8 @@
}
],
"require": {
"php": "^7.0",
"automattic/vipwpcs": "^0.4.0",
"wp-coding-standards/wpcs": "^1.2.1"
"php": "^7.2",
"wp-coding-standards/wpcs": "^2.1"
},
"require-dev": {
"roave/security-advisories": "dev-master"
Expand All @@ -40,7 +39,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.2.x-dev"
"dev-master": "0.3.x-dev"
}
},
"prefer-stable": true,
Expand Down

0 comments on commit b3862fb

Please sign in to comment.