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/admin/includesTheme.php

    r42343 r43571  
    5454                                'Sub Dir'                             => 'subdir/template-sub-dir.php',
    5555                                'This Template Header Is On One Line' => 'template-header.php',
    56                         ), get_page_templates()
     56                        ),
     57                        get_page_templates()
    5758                );
    5859
    … …  
    6768                                'Sub Dir'                             => 'subdir/template-sub-dir.php',
    6869                                'This Template Header Is On One Line' => 'template-header.php',
    69                         ), get_page_templates()
     70                        ),
     71                        get_page_templates()
    7072                );
    7173        }
    … …  
    8486                                'Top Level' => 'template-top-level-post-types.php',
    8587                                'Sub Dir'   => 'subdir/template-sub-dir-post-types.php',
    86                         ), get_page_templates( null, 'foo' )
     88                        ),
     89                        get_page_templates( null, 'foo' )
    8790                );
    8891                $this->assertEqualSetsWithIndex(
    … …  
    9093                                'Top Level' => 'template-top-level-post-types.php',
    9194                                'Sub Dir'   => 'subdir/template-sub-dir-post-types.php',
    92                         ), get_page_templates( null, 'post' )
     95                        ),
     96                        get_page_templates( null, 'post' )
    9397                );
    9498                $this->assertEquals( array(), get_page_templates( null, 'bar' ) );
    … …  
    112116                                'Trailing White Space, Period.' => '38766/trailing-whitespace-period-post-types.php',
    113117                                'Tilde in Post Type.'           => '38766/tilde-post-types.php',
    114                         ), get_page_templates( null, 'period' )
     118                        ),
     119                        get_page_templates( null, 'period' )
    115120                );
    116121                $this->assertEqualSetsWithIndex(
    … …  
    121126                                'Trailing Period, White Space.' => '38766/trailing-period-whitespace-post-types.php',
    122127                                'Trailing White Space, Period.' => '38766/trailing-whitespace-period-post-types.php',
    123                         ), get_page_templates( null, 'full-stop' )
     128                        ),
     129                        get_page_templates( null, 'full-stop' )
    124130                );
    125131        }
    … …  
    140146                                'Top Level In A Child Theme' => 'template-top-level-post-types-child.php',
    141147                                'Sub Dir In A Child Theme'   => 'subdir/template-sub-dir-post-types-child.php',
    142                         ), get_page_templates( null, 'foo' )
     148                        ),
     149                        get_page_templates( null, 'foo' )
    143150                );
    144151
    … …  
    147154                                'Top Level' => 'template-top-level-post-types.php',
    148155                                'Sub Dir'   => 'subdir/template-sub-dir-post-types.php',
    149                         ), get_page_templates( null, 'post' )
     156                        ),
     157                        get_page_templates( null, 'post' )
    150158                );
    151159
    … …  
    155163                                'Sub Dir'                             => 'subdir/template-sub-dir.php',
    156164                                'This Template Header Is On One Line' => 'template-header.php',
    157                         ), get_page_templates()
     165                        ),
     166                        get_page_templates()
    158167                );
    159168
    … …  
    178187                                'template-top-level-post-types-child.php' => 'Top Level In A Child Theme',
    179188                                'subdir/template-sub-dir-post-types-child.php' => 'Sub Dir In A Child Theme',
    180                         ), $post_templates['foo']
     189                        ),
     190                        $post_templates['foo']
    181191                );
    182192
    … …  
    185195                                'template-top-level-post-types.php'      => 'Top Level',
    186196                                'subdir/template-sub-dir-post-types.php' => 'Sub Dir',
    187                         ), $post_templates['post']
     197                        ),
     198                        $post_templates['post']
    188199                );
    189200
    … …  
    193204                                'subdir/template-sub-dir.php' => 'Sub Dir',
    194205                                'template-header.php'         => 'This Template Header Is On One Line',
    195                         ), $post_templates['page']
     206                        ),
     207                        $post_templates['page']
    196208                );
    197209        }
Note: See TracChangeset for help on using the changeset viewer.