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
+10 -5
View File
@@ -137,7 +137,8 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
function test_redirect_on_head() {
// Redirections on HEAD request when Requested
$res = wp_remote_request(
$this->redirection_script . '?rt=' . 5, array(
$this->redirection_script . '?rt=' . 5,
array(
'redirection' => 5,
'method' => 'HEAD',
)
@@ -208,7 +209,8 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
// Test 301 - POST to POST
$res = wp_remote_request(
$url, array(
$url,
array(
'method' => 'PUT',
'timeout' => 30,
)
@@ -255,7 +257,8 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
$url = $this->fileStreamUrl;
$size = 153204;
$res = wp_remote_request(
$url, array(
$url,
array(
'stream' => true,
'timeout' => 30,
)
@@ -282,7 +285,8 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
$url = $this->fileStreamUrl;
$size = 10000;
$res = wp_remote_request(
$url, array(
$url,
array(
'stream' => true,
'timeout' => 30,
'limit_response_size' => $size,
@@ -311,7 +315,8 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
$size = 10000;
$res = wp_remote_request(
$url, array(
$url,
array(
'timeout' => 30,
'limit_response_size' => $size,
)
+2 -1
View File
@@ -15,7 +15,8 @@ class Tests_HTTP_curl extends WP_HTTP_UnitTestCase {
public function test_http_api_curl_stream_parameter_is_a_reference() {
add_action( 'http_api_curl', array( $this, '_action_test_http_api_curl_stream_parameter_is_a_reference' ), 10, 3 );
wp_remote_request(
$this->fileStreamUrl, array(
$this->fileStreamUrl,
array(
'stream' => true,
'timeout' => 30,
)
+4 -2
View File
@@ -148,7 +148,8 @@ class Tests_HTTP_Functions extends WP_UnitTestCase {
$url = 'http://example.org';
$response = wp_remote_get(
$url, array(
$url,
array(
'cookies' => array(
new WP_Http_Cookie(
array(
@@ -179,7 +180,8 @@ class Tests_HTTP_Functions extends WP_UnitTestCase {
$url = 'http://example.org';
$response = wp_remote_get(
$url, array(
$url,
array(
'cookies' => array(
'test' => 'foo',
),
+2 -1
View File
@@ -190,7 +190,8 @@ class Tests_HTTP_HTTP extends WP_UnitTestCase {
'path' => '/path',
'query' => 'arg1=value1&arg2=value2',
'fragment' => 'anchor',
), $actual
),
$actual
);
}