Skip to content

Conversation

@david-binda
Copy link
Contributor

This commit makes changes necessary for succesffully runnig the WordPressVIPMinimum standard sniffs against both, PHPCS 2.x and 3.x.

Due to the project's dependency on the WPCS, it is now loading the backward compatibility code from the upstream repository and enhances it for some missing parts from there.

All tests are now also aliasing the AbstractSniffUnitTest if needed - when run against PHPCS 3.x.

This commit makes changes necessary for succesffully runnig the WordPressVIPMinimum standard sniffs against both, PHPCS 2.x and 3.x.

Due to the project's dependency on the WPCS, it is now loading the backward compatibility code from the upstream repository and enhances it for some missing parts from there.

All tests are now also aliasing the `AbstractSniffUnitTest` if needed - when run against PHPCS 3.x.
Since the upstream repositories, both PHPCS and WPCS, have dropped support for PHP 5.2, we should as well.
…tory (WPCS).

The modifications contain:
* Adding both, VIPCS and WPCS to the PHPCS installed pats config
* Running phpunit with loaded AllTests.php from WPCS
* Adjusting the paths of XML files which are being linted
Those changes copy the improvements done in the upstream repository (WPCS).
We'll have to address those issues in near future (in order to be on par with the upstream standards), but it does not feel necessary in terms of making sure the VIPCS supports both PHPCS 2.x and 3.x
Fatal error: Class 'WordPress_AbstractArrayAssignmentRestrictionsSniff' not found in /home/travis/build/Automattic/VIP-Coding-Standards/WordPressVIPMinimum/Sniffs/VIP/RegexpCompareSniff.php on line 13
…and WPCS > 0.1.3 (thus the autoloading is not taking effect)
There is no simple path for supporting WPCS prior to 0.1.3
…iff accordingly to the parent theme, as not using one is breaking the identifications of individual sniffs on ruleset.xml level and thus breaking message escallation and overriding.
…tandard.

Re-enable the PSR1 Class Declaration sniff for the code style of the project itself.
/s/Actions_PreGetPostsSniff/PreGetPostsSniff/
@david-binda david-binda merged commit 682ed63 into master Aug 15, 2017
@sboisvert sboisvert deleted the phpcs3-compat branch May 15, 2018 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants