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

View File

@@ -1336,7 +1336,7 @@ if ( ! function_exists( 'wp_safe_redirect' ) ) :
* @param string $location The path or URL to redirect to.
* @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily).
* @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'.
* @return bool $redirect False if the redirect was cancelled, true otherwise.
* @return bool $redirect False if the redirect was cancelled, true otherwise.
*/
function wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) {
@@ -1753,8 +1753,10 @@ if ( ! function_exists( 'wp_notify_moderator' ) ) :
$notify_message .= sprintf(
_n(
'Currently %s comment is waiting for approval. Please visit the moderation panel:',
'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting
), number_format_i18n( $comments_waiting )
'Currently %s comments are waiting for approval. Please visit the moderation panel:',
$comments_waiting
),
number_format_i18n( $comments_waiting )
) . "\r\n";
$notify_message .= admin_url( 'edit-comments.php?comment_status=moderated#wpbody-content' ) . "\r\n";
@@ -2489,10 +2491,12 @@ if ( ! function_exists( 'wp_set_password' ) ) :
$hash = wp_hash_password( $password );
$wpdb->update(
$wpdb->users, array(
$wpdb->users,
array(
'user_pass' => $hash,
'user_activation_key' => '',
), array( 'ID' => $user_id )
),
array( 'ID' => $user_id )
);
wp_cache_delete( $user_id, 'users' );