This repository was archived by the owner on Sep 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 825
Update CS setup #1399
Copy link
Copy link
Open
Description
The current code style and PHP compatibility setup is pretty out-of-date, inconsistent and convoluted:
- The Travis script seems to try use your theme to unit test PHPCompatibility.
Honestly, you don't have to as PHPCompatibility does extensive unit testing itself.
Just run it once on a high PHP version with a properly settestVersionand you're done - or in case you want to test separately for compatibility with PHP 5.6 and above and compatibility with PHP 5.2/5.3-5.5, run it twice, but running it the way it's done now.... is really not very effective.
See: https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions - As this is a WordPress theme, you probably should use
PHPCompatibilityWPinstead ofPHPCompatibility.
See: https://github.com/PHPCompatibility/PHPCompatibilityWP - The Composer file is pointing to the abandoned
wimg/php-compatibilityrepo.
The package was moved tophpcompatibility/php-compatibilitya year ago.... squizlabs/php_codesnifferis not a direct dependency for your theme, but a dependency of PHPCompatibility(WP). Don'trequireit, but let the package which depends on it manage the supported versions.- The DealerDirect PHPCS Composer plugin has released a new version and should be updated to use
^0.5.0.
Composer treats minors < 1.0 as majors, so this needs to be done explicitly.
See: https://github.com/Dealerdirect/phpcodesniffer-composer-installer/releases - You seem to include a
codesniffer.ruleset.xmlfile, but don'trequire-devthe needed dependency (WPCS) for it. - The WPCS version which the ruleset seems to be based on is very much out of date and a number of sniffs have been renamed since. This ruleset will not work anymore.
- The ruleset has a non-standard name which means that PHPCS will not pick up on it automatically.
Please consider renaming the file tophpcs.xml.dist. - The code is not actually checked against the ruleset via Travis anyway, so what is going on here ?
- Please consider using the WP ThemeReview ruleset: https://github.com/WPTRT/WPThemeReview
If this is truly intended as a starter-theme, I would strongly suggest leading by example and setting these things up properly and correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels