Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Update for PHPCS 3.x and WPCS 0.14.1 #145
This PR does a back-merge of WPCS to WPTRT based on WPCS
It then applies a number of commits to make the Theme sniffs consistent with developments in WPCS upstream.
Lastly, it updates the sniffs to be compatible with PHPCS 3.x.
Merge branch 'master' into WPTRT/feature/update-forPHPCS-3.x-WPCS-0.14
Note: For now, I've used the
DeprecatedWPConstants: Remove sniff in favour of WPCS sniff
WPCS 0.14.0 introduced a
Leverage the WordPress_Sniff class for all sniffs
Most WPCS sniffs extend the WordPress_Sniff class or one of the abstract WP sniffs. However there were some which so far didn't.
This PR changes that whenever possible.
The affected sniffs do not necessarily need to use the WordPress_Sniff class as they don't use any of the utility methods or properties contained therein, however it will make future development slightly more intuitive as (nearly) all sniffs now follow the same pattern.
This same change has been made upstream in WordPress-Coding-Standards/WordPress-Coding-Standards#967
Documentation: Fix two outdated & incorrect code samples
This same change has been made upstream in WordPress-Coding-Standards/WordPress-Coding-Standards#812
PHPCS 3.x compat: Ruleset: Make sure the complete sniff is included, not just an errorcode
In PHPCS 2.x when a sniff was referenced by errorcode, this automatically included the whole sniff.
This allows for cross-version compat and ensures that if/when new errorcodes are added to the sniffs, they will be included as well.
PHPCS 3.x compat: Namespace all sniffs which extend from one of the WPCS base sniffs
PHPCS 3.x compat: Fix all references to upstream PHPCS classes
PHPCS 3.x compat: Add autoload directive for the alias file
PHPCS 3.x compat: Namespace all unit tests
PHPCS 3.x compat: Remove test conditionals for PHP 5.2
Minor code layout & code style fixes
Clean up: Remove
I have reviewed the files that I have been edited in
/Theme/. I expect the rest of the changes are from
I wonder if we can get the git rename fixed.
That's just an artifact of the fact that we do a back-merge here. It may look a little weird when viewing the Git history, but I can't partially back-merge. In WPCS the history is unbroken.
As there is a proposal to make this repo stand-alone, this may soon not be relevant anymore anyway.