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 -6
View File
@@ -239,7 +239,8 @@ function edit_post( $post_data = null ) {
if ( post_type_supports( $ptype->name, 'revisions' ) ) {
$revisions = wp_get_post_revisions(
$post_ID, array(
$post_ID,
array(
'order' => 'ASC',
'posts_per_page' => 1,
)
@@ -955,8 +956,10 @@ function has_meta( $postid ) {
$wpdb->prepare(
"SELECT meta_key, meta_value, meta_id, post_id
FROM $wpdb->postmeta WHERE post_id = %d
ORDER BY meta_key,meta_id", $postid
), ARRAY_A
ORDER BY meta_key,meta_id",
$postid
),
ARRAY_A
);
}
@@ -1701,7 +1704,7 @@ function _admin_notice_post_locked() {
<a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a>
<?php if ( $preview_link ) { ?>
<a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e( 'Preview' ); ?></a>
<?php
<?php
}
// Allow plugins to prevent some users overriding the post lock
@@ -1711,7 +1714,7 @@ if ( $override ) {
<?php
}
?>
?>
</p>
</div>
<?php
@@ -2002,7 +2005,8 @@ function taxonomy_meta_box_sanitize_cb_input( $taxonomy, $terms ) {
}
$_term = get_terms(
$taxonomy, array(
$taxonomy,
array(
'name' => $term,
'fields' => 'ids',
'hide_empty' => false,