Build/Tools: Update PHPCS ruleset for WP Core and related Composer setup.

`.gitignore` + `svn:ignore`:
* Add the typical filenames of overloaded PHPCS configs to `.gitignore`.

Composer:
* Use the `develop` (Packagist `dev-master`) version of WPCS as it contains lots of bugfixes.
* Remove the PHPCS dependency. This is a dependency of WPCS, not of WP Core itself. This will also make sure that the PHPCS version used is always one which is supported by WPCS.
* Refreshed the `composer.lock` file.

PHPCS ruleset:
* Removed a reference to a sniff which doesn't exist in WPCS yet.
* Use the PHPCS 3.x `basepath` option to clean up the file paths PHPCS shows in the reports.
* Use the PHPCS 3.x `parallel` option to enable parallel scanning whenever possible to speed up the scans.
* Whitelist the `wp-includes/l10n.php` file from issues being reported by the `WordPress.WP.I18n` sniff.

Fixes #44366.

git-svn-id: https://develop.svn.wordpress.org/trunk@43348 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
jrf
2018-06-15 15:56:58 +00:00
parent 78f2b0e731
commit 3581d34bb0
4 changed files with 26 additions and 14 deletions
+12 -1
View File
@@ -4,10 +4,15 @@
<rule ref="WordPress-Core"/>
<rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
<rule ref="WordPress.Commenting.DocblockFormat"/>
<arg name="extensions" value="php"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 20 files simultanously. -->
<arg name="parallel" value="20"/>
<!-- Show sniff codes in all reports -->
<arg value="ps"/>
@@ -69,6 +74,12 @@
<exclude-pattern>/tests/phpunit/tests/db\.php</exclude-pattern>
</rule>
<!-- Whitelist the I18n functions file from issues identified by the I18n sniff
(such as calling the low-level translate() function). -->
<rule ref="WordPress.WP.I18n">
<exclude-pattern>/src/wp-includes/l10n\.php</exclude-pattern>
</rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing">
<exclude-pattern>/wp-config\.php</exclude-pattern>
<exclude-pattern>/wp-config-sample\.php</exclude-pattern>