WPTT / WPThemeReview

PHP_CodeSniffer rules (sniffs) to enforce WordPress theme review coding conventions
MIT License
208 stars 38 forks source link

Update to WordPressCS 2.0.0 #194

Closed jrfnl closed 5 years ago

jrfnl commented 5 years ago

WordPressCS 2.0.0 has just been released and contains breaking changes.

This PR makes all the updates needed for WPTRT to move to a minimum WPCS requirement of 2.0.0.

Also see: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-2.0.0-for-Developers-of-external-standards

Fixes #193

Commit Summary

Composer: update requirements for WPCS 2.0.0

Sniffs: update the WPCS namespace

PHPUnit: Remove test bootstrap

As WPCS 2.0.0 has dropped the PHPCSAliases file, there is now only one (external) bootstrap file which needs to be loaded to run the unit tests: the PHPCS native bootstrap which provided cross-version support for various PHPUnit versions.

With only one bootstrap file to load, we can just let PHPUnit handle this.

So, this commit removes the TRTCS native bootstrap.php file and makes some related adjustments.

Ruleset tweaks: remove encoding

The default encoding as of PHPCS 3.0.0 is utf-8, so we don't actually need to set this.

Ruleset tweaks: limit PHPCompatibility to PHP files

Composer tweaks: improve readability of script section

Contributing: minor textual tweaks + update the PHPUnit output example

Ruleset: add dev note for the future

dingo-d commented 5 years ago

You've beat me to it :smile: I'll take a look at the PR 🙂

jrfnl commented 5 years ago

You've beat me to it

Well, I did mention in #193 that I would send in a PR for this. I'd opened the issue to prevent people doing double work as I had the branch ready already.

dingo-d commented 5 years ago

All seems to be passing, I'll merge this to develop and ask people to test before releasing an update. That sounds ok?

jrfnl commented 5 years ago

@dingo-d Sounds good to me.