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
+11 -9
View File
@@ -62,16 +62,16 @@ if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', '
<?php if ( ! get_pages() ) : ?>
<input name="show_on_front" type="hidden" value="posts" />
<table class="form-table">
<?php
if ( 'posts' != get_option( 'show_on_front' ) ) :
update_option( 'show_on_front', 'posts' );
<?php
if ( 'posts' != get_option( 'show_on_front' ) ) :
update_option( 'show_on_front', 'posts' );
endif;
else :
if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) {
update_option( 'show_on_front', 'posts' );
}
?>
?>
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Your homepage displays' ); ?></th>
@@ -90,7 +90,8 @@ else :
<li><label for="page_on_front">
<?php
printf(
__( 'Homepage: %s' ), wp_dropdown_pages(
__( 'Homepage: %s' ),
wp_dropdown_pages(
array(
'name' => 'page_on_front',
'echo' => 0,
@@ -100,12 +101,13 @@ else :
)
)
);
?>
?>
</label></li>
<li><label for="page_for_posts">
<?php
printf(
__( 'Posts page: %s' ), wp_dropdown_pages(
__( 'Posts page: %s' ),
wp_dropdown_pages(
array(
'name' => 'page_for_posts',
'echo' => 0,
@@ -115,10 +117,10 @@ else :
)
)
);
?>
?>
</label></li>
</ul>
<?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
<?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
<div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
<?php endif; ?>
</fieldset></td>