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.


Built from https://develop.svn.wordpress.org/trunk@43571


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast
2018-08-17 01:51:36 +00:00
parent 8142df82bc
commit 56c162fbc9
359 changed files with 5715 additions and 4599 deletions

View File

@@ -104,19 +104,19 @@ function install_theme_search_form( $type_selector = true ) {
<option value="tag" <?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Theme Installer' ); ?></option>
</select>
<label class="screen-reader-text" for="s">
<?php
switch ( $type ) {
case 'term':
_e( 'Search by keyword' );
break;
case 'author':
_e( 'Search by author' );
break;
case 'tag':
_e( 'Search by tag' );
break;
}
?>
<?php
switch ( $type ) {
case 'term':
_e( 'Search by keyword' );
break;
case 'author':
_e( 'Search by author' );
break;
case 'tag':
_e( 'Search by tag' );
break;
}
?>
</label>
<?php else : ?>
<label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); ?></label>
@@ -124,7 +124,7 @@ function install_theme_search_form( $type_selector = true ) {
<input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term ); ?>" autofocus="autofocus" />
<?php submit_button( __( 'Search' ), '', 'search', false ); ?>
</form>
<?php
<?php
}
/**
@@ -134,7 +134,7 @@ function install_theme_search_form( $type_selector = true ) {
*/
function install_themes_dashboard() {
install_theme_search_form( false );
?>
?>
<h4><?php _e( 'Feature Filter' ); ?></h4>
<p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p>
@@ -152,7 +152,7 @@ function install_themes_dashboard() {
foreach ( $features as $feature => $feature_name ) {
$feature_name = esc_html( $feature_name );
$feature = esc_attr( $feature );
?>
?>
<li>
<input type="checkbox" name="features[]" id="feature-id-<?php echo $feature; ?>" value="<?php echo $feature; ?>" />
@@ -162,22 +162,22 @@ function install_themes_dashboard() {
<?php } ?>
</ol>
<br class="clear" />
<?php
<?php
}
?>
</div>
<br class="clear" />
<?php submit_button( __( 'Find Themes' ), '', 'search' ); ?>
<?php submit_button( __( 'Find Themes' ), '', 'search' ); ?>
</form>
<?php
<?php
}
/**
* @since 2.8.0
*/
function install_themes_upload() {
?>
?>
<p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install it by uploading it here.' ); ?></p>
<form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>">
<?php wp_nonce_field( 'theme-upload' ); ?>