Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2018-08-17 01:50:26 +00:00
parent fed48ba3fe
commit a75d153eee
549 changed files with 9936 additions and 6721 deletions
+14 -1
View File
@@ -5,6 +5,12 @@
<rule ref="WordPress-Core"/>
<rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="allowMultipleArguments" value="false"/>
</properties>
</rule>
<arg name="extensions" value="php"/>
<!-- Strip the filepaths down to the relevant bit. -->
@@ -18,8 +24,10 @@
<file>.</file>
<!-- Exclude the build folder in the current directory, as Travis puts the checkout in a build directory. -->
<exclude-pattern type="relative">^build/*</exclude-pattern>
<!-- Directories and third party library exclusions -->
<exclude-pattern>/build/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
@@ -87,6 +95,11 @@
<exclude-pattern>/wp-tests-config-sample\.php</exclude-pattern>
</rule>
<rule ref="Generic.Files.LineEndings">
<exclude-pattern>/wp-config\.php</exclude-pattern>
<exclude-pattern>/wp-config-sample\.php</exclude-pattern>
</rule>
<!-- Whitelist test classes for select sniffs. -->
<rule ref="WordPress.Files.FileName">
<properties>