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/rest-api/rest-controller.php

    r43087 r43571  
    1515        parent::setUp();
    1616        $this->request = new WP_REST_Request(
    17             'GET', '/wp/v2/testroute', array(
     17            'GET',
     18            '/wp/v2/testroute',
     19            array(
    1820                'args' => array(
    1921                    'someinteger' => array(
     
    206208        $request    = new WP_REST_Request( 'GET', '/wp/v2/testroute' );
    207209        $fields     = $controller->get_fields_for_response( $request );
    208         $this->assertEquals( array(
    209             'somestring',
    210             'someinteger',
    211             'someboolean',
    212             'someurl',
    213             'somedate',
    214             'someemail',
    215             'someenum',
    216             'someargoptions',
    217             'somedefault',
    218         ), $fields );
     210        $this->assertEquals(
     211            array(
     212                'somestring',
     213                'someinteger',
     214                'someboolean',
     215                'someurl',
     216                'somedate',
     217                'someemail',
     218                'someenum',
     219                'someargoptions',
     220                'somedefault',
     221            ),
     222            $fields
     223        );
    219224        $request->set_param( '_fields', 'somestring,someinteger' );
    220225        $fields = $controller->get_fields_for_response( $request );
    221         $this->assertEquals( array(
    222             'somestring',
    223             'someinteger',
    224         ), $fields );
     226        $this->assertEquals(
     227            array(
     228                'somestring',
     229                'someinteger',
     230            ),
     231            $fields
     232        );
    225233    }
    226234}
Note: See TracChangeset for help on using the changeset viewer.