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/tests/phpunit/tests/user/listAuthors.php

    r42382 r43571  
    8383                $expected['post_count'] = '<li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a></li><li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a></li>';
    8484                $this->AssertEquals(
    85                         $expected['post_count'], wp_list_authors(
     85                        $expected['post_count'],
     86                        wp_list_authors(
    8687                                array(
    8788                                        'echo'    => false,
    … …  
    9596                $expected['id'] = '<li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a></li><li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a></li>';
    9697                $this->AssertEquals(
    97                         $expected['id'], wp_list_authors(
     98                        $expected['id'],
     99                        wp_list_authors(
    98100                                array(
    99101                                        'echo'    => false,
    … …  
    108110                $expected['optioncount'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> (2)</li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a> (3)</li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a> (1)</li>';
    109111                $this->AssertEquals(
    110                         $expected['optioncount'], wp_list_authors(
     112                        $expected['optioncount'],
     113                        wp_list_authors(
    111114                                array(
    112115                                        'echo'        => false,
    … …  
    126129                $expected['exclude_admin'] = '<li><a href="' . get_author_posts_url( 1 ) . '" title="Posts by admin">admin</a></li><li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a></li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a></li>';
    127130                $this->AssertEquals(
    128                         $expected['exclude_admin'], wp_list_authors(
     131                        $expected['exclude_admin'],
     132                        wp_list_authors(
    129133                                array(
    130134                                        'echo'          => false,
    … …  
    138142                $expected['show_fullname'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob reno</a></li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul norris</a></li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack moon</a></li>';
    139143                $this->AssertEquals(
    140                         $expected['show_fullname'], wp_list_authors(
     144                        $expected['show_fullname'],
     145                        wp_list_authors(
    141146                                array(
    142147                                        'echo'          => false,
    … …  
    151156                $expected['hide_empty'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li><li><a href="' . get_author_posts_url( $fred_id ) . '" title="Posts by fred">fred</a></li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a></li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a></li>';
    152157                $this->AssertEquals(
    153                         $expected['hide_empty'], wp_list_authors(
     158                        $expected['hide_empty'],
     159                        wp_list_authors(
    154160                                array(
    155161                                        'echo'       => false,
    … …  
    172178                $expected['feed'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> (<a href="' . $url1 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a> (<a href="' . $url2 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a> (<a href="' . $url0 . '">link to feed</a>)</li>';
    173179                $this->AssertEquals(
    174                         $expected['feed'], wp_list_authors(
     180                        $expected['feed'],
     181                        wp_list_authors(
    175182                                array(
    176183                                        'echo' => false,
    … …  
    187194                $expected['feed_image'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> <a href="' . $url1 . '"><img src="http://' . WP_TESTS_DOMAIN . '/path/to/a/graphic.png" style="border: none;" /></a></li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a> <a href="' . $url2 . '"><img src="http://' . WP_TESTS_DOMAIN . '/path/to/a/graphic.png" style="border: none;" /></a></li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a> <a href="' . $url0 . '"><img src="http://' . WP_TESTS_DOMAIN . '/path/to/a/graphic.png" style="border: none;" /></a></li>';
    188195                $this->AssertEquals(
    189                         $expected['feed_image'], wp_list_authors(
     196                        $expected['feed_image'],
     197                        wp_list_authors(
    190198                                array(
    191199                                        'echo'       => false,
    … …  
    205213                $expected['feed_type'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> (<a href="' . $url1 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a> (<a href="' . $url2 . '">link to feed</a>)</li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a> (<a href="' . $url0 . '">link to feed</a>)</li>';
    206214                $this->AssertEquals(
    207                         $expected['feed_type'], wp_list_authors(
     215                        $expected['feed_type'],
     216                        wp_list_authors(
    208217                                array(
    209218                                        'echo'      => false,
    … …  
    218227                $expected['style'] = '<a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a>, <a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a>, <a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a>';
    219228                $this->AssertEquals(
    220                         $expected['style'], wp_list_authors(
     229                        $expected['style'],
     230                        wp_list_authors(
    221231                                array(
    222232                                        'echo'  => false,
    … …  
    230240                $expected['html'] = 'bob, paul, zack';
    231241                $this->AssertEquals(
    232                         $expected['html'], wp_list_authors(
     242                        $expected['html'],
     243                        wp_list_authors(
    233244                                array(
    234245                                        'echo' => false,
Note: See TracChangeset for help on using the changeset viewer.