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/term/getTagLink.php

    r42366 r43571  
    77class Tests_Term_GetTagLink extends WP_UnitTestCase {
    88        public function test_success() {
    9                 $t = self::factory()->term->create( array(
    10                         'taxonomy' => 'post_tag',
    11                         'slug' => 'term-slug',
    12                 ) );
     9                $t = self::factory()->term->create(
     10                        array(
     11                                'taxonomy' => 'post_tag',
     12                                'slug'     => 'term-slug',
     13                        )
     14                );
    1315
    14                 $found = get_tag_link( $t );
     16                $found    = get_tag_link( $t );
    1517                $expected = home_url( '?tag=term-slug' );
    1618
    … …  
    2426                register_taxonomy( 'wptests_tax', 'post' );
    2527
    26                 $t = self::factory()->term->create( array(
    27                         'taxonomy' => 'wptests_tax',
    28                         'slug'     => 'test-term',
    29                 ) );
     28                $t = self::factory()->term->create(
     29                        array(
     30                                'taxonomy' => 'wptests_tax',
     31                                'slug'     => 'test-term',
     32                        )
     33                );
    3034
    3135                $term = get_term( $t );
    3236
    33                 $found = get_tag_link( $t );
     37                $found    = get_tag_link( $t );
    3438                $expected = home_url( '?wptests_tax=test-term' );
    3539
    … …  
    4347                register_taxonomy( 'wptests_tax', 'post' );
    4448
    45                 $t = self::factory()->term->create( array(
    46                         'taxonomy' => 'wptests_tax',
    47                         'slug'     => 'test-term',
    48                 ) );
     49                $t = self::factory()->term->create(
     50                        array(
     51                                'taxonomy' => 'wptests_tax',
     52                                'slug'     => 'test-term',
     53                        )
     54                );
    4955
    5056                clean_term_cache( $t );
    5157
    52                 $found = get_tag_link( $t );
     58                $found    = get_tag_link( $t );
    5359                $expected = home_url( '?wptests_tax=test-term' );
    5460
Note: See TracChangeset for help on using the changeset viewer.