WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (3 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/tests/phpunit/tests/functions/getArchives.php

    r42382 r43571  
    2222    public static function wpSetUpBeforeClass( $factory ) {
    2323        self::$post_ids = $factory->post->create_many(
    24             8, array(
     24            8,
     25            array(
    2526                'post_type'   => 'post',
    2627                'post_author' => '1',
     
    3738        $expected['type'] = "<li><a href='" . $this->year_url . "'>" . date( 'Y' ) . '</a></li>';
    3839        $this->assertEquals(
    39             $expected['type'], trim(
     40            $expected['type'],
     41            trim(
    4042                wp_get_archives(
    4143                    array(
     
    7173EOF;
    7274        $this->assertEquals(
    73             $expected['limit'], trim(
     75            $expected['limit'],
     76            trim(
    7477                wp_get_archives(
    7578                    array(
     
    8689        $expected['format'] = "<option value='" . $this->month_url . "'> " . date( 'F Y' ) . ' </option>';
    8790        $this->assertEquals(
    88             $expected['format'], trim(
     91            $expected['format'],
     92            trim(
    8993                wp_get_archives(
    9094                    array(
     
    100104        $expected['before_and_after'] = "<div><a href='" . $this->month_url . "'>" . date( 'F Y' ) . '</a></div>';
    101105        $this->assertEquals(
    102             $expected['before_and_after'], trim(
     106            $expected['before_and_after'],
     107            trim(
    103108                wp_get_archives(
    104109                    array(
     
    116121        $expected['show_post_count'] = "<li><a href='" . $this->month_url . "'>" . date( 'F Y' ) . '</a>&nbsp;(8)</li>';
    117122        $this->assertEquals(
    118             $expected['show_post_count'], trim(
     123            $expected['show_post_count'],
     124            trim(
    119125                wp_get_archives(
    120126                    array(
     
    149155EOF;
    150156        $this->assertEquals(
    151             $expected['order_asc'], trim(
     157            $expected['order_asc'],
     158            trim(
    152159                wp_get_archives(
    153160                    array(
     
    164171EOF;
    165172        $this->assertEquals(
    166             $expected['order_desc'], trim(
     173            $expected['order_desc'],
     174            trim(
    167175                wp_get_archives(
    168176                    array(
Note: See TracChangeset for help on using the changeset viewer.