The current version of woocommerce/woocommerce-sniffs includes all the other PHPCS related dependencies, so those can all be removed in favour of updating the woocommerce/woocommerce-sniffs dependency which will set them up anyway.
Update the scripts to point to the versions of tooling installed via Composer, rather than presuming there will be globally installed versions somewhere on contributor's systems.
PHPCS ruleset:
Rename the ruleset to phpcs.xml.dist. This allows devs to overload the file using [.]phpcs.xml.
Includes adding the file names of the supported overload files to .gitignore.
Set the command line arguments needed in the ruleset:
Set the files to check to all.
Exclude the vendor directory.
Set the basepath for cleaner output.
Allow PHPCS to scan files in parallel.
Fix the minimum_supported_wp_version setting.
WP 7.0 is still years away, so that setting was without merit.
As the documentation does not include any information about the minimum supported WP version, setting it to WP 5.0 for now.
As the WooCommerce-Core ruleset already includes the WordPress and PHPCompatibility(WP) rulesets, no need to explicitely include those.
Cleaned up the sniff exclusions as most excluded sniffs are no longer part of WordPressCS anyway.
Removed most sniff property configurations as this configuration is now included by default in the WooCommerce-Core ruleset, so will automatically be inherited.
Added four new exclusions for new errors thrown now WordPressCS has been updated: WordPress.DateTime.RestrictedFunctions.date_date and three error codes from the PEAR.Functions.FunctionCallSignature sniff.
These should probably be reviewed and fixed, but that's for someone else to do.
Composer:
woocommerce/woocommerce-sniffs
includes all the other PHPCS related dependencies, so those can all be removed in favour of updating thewoocommerce/woocommerce-sniffs
dependency which will set them up anyway.PHPCS ruleset:
phpcs.xml.dist
. This allows devs to overload the file using[.]phpcs.xml
. Includes adding the file names of the supported overload files to.gitignore
.vendor
directory.minimum_supported_wp_version
setting. WP 7.0 is still years away, so that setting was without merit. As the documentation does not include any information about the minimum supported WP version, setting it to WP5.0
for now.WooCommerce-Core
ruleset already includes theWordPress
andPHPCompatibility(WP)
rulesets, no need to explicitely include those.WooCommerce-Core
ruleset, so will automatically be inherited.WordPress.DateTime.RestrictedFunctions.date_date
and three error codes from thePEAR.Functions.FunctionCallSignature
sniff. These should probably be reviewed and fixed, but that's for someone else to do.Ref:
Related PRs: #32, #33, #34