Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (8 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r43377 r43571  
    131131                         */
    132132                        $cockney = explode(
    133                                 ',', _x(
     133                                ',',
     134                                _x(
    134135                                        "'tain't,'twere,'twas,'tis,'twill,'til,'bout,'nuff,'round,'cause,'em",
    135136                                        'Comma-separated list of words to texturize in your language'
     
    138139
    139140                        $cockneyreplace = explode(
    140                                 ',', _x(
     141                                ',',
     142                                _x(
    141143                                        '’tain’t,’twere,’twas,’tis,’twill,’til,’bout,’nuff,’round,’cause,’em',
    142144                                        'Comma-separated list of replacement words in your language'
     
    22632265                                '%cc%84',
    22642266                                '%cc%8c',
    2265                         ), '', $title
     2267                        ),
     2268                        '',
     2269                        $title
    22662270                );
    22672271
     
    30733077
    30743078        if ( ! empty( $rel_match[0] ) ) {
    3075                 $parts = preg_split( '|\s+|', strtolower( $rel_match[2] ) );
    3076                 $parts = array_map( 'esc_attr', $parts );
    3077                 $needed = explode( ' ', $rel );
    3078                 $parts = array_unique( array_merge( $parts, $needed ) );
     3079                $parts     = preg_split( '|\s+|', strtolower( $rel_match[2] ) );
     3080                $parts     = array_map( 'esc_attr', $parts );
     3081                $needed    = explode( ' ', $rel );
     3082                $parts     = array_unique( array_merge( $parts, $needed ) );
    30793083                $delimiter = trim( $rel_match[1] ) ? $rel_match[1] : '"';
    3080                 $rel = 'rel=' . $delimiter . trim( implode( ' ', $parts ) ) . $delimiter;
     3084                $rel       = 'rel=' . $delimiter . trim( implode( ' ', $parts ) ) . $delimiter;
    30813085                $link_html = str_replace( $rel_match[0], $rel, $link_html );
    30823086        } else {
     
    48444848         */
    48454849        $l = apply_filters(
    4846                 'wp_sprintf_l', array(
     4850                'wp_sprintf_l',
     4851                array(
    48474852                        /* translators: used to join items in a list with more than 2 items */
    48484853                        'between'          => sprintf( __( '%1$s, %2$s' ), '', '' ),
     
    53375342
    53385343        $printed = true;
    5339 ?>
     5344        ?>
    53405345<style type="text/css">
    53415346img.wp-smiley,
     
    53525357}
    53535358</style>
    5354 <?php
     5359        <?php
    53555360}
    53565361
Note: See TracChangeset for help on using the changeset viewer.