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/src/wp-includes/functions.wp-scripts.php

    r42843 r43571  
    4040
    4141    _doing_it_wrong(
    42         $function, sprintf(
     42        $function,
     43        sprintf(
    4344            /* translators: 1: wp_enqueue_scripts, 2: admin_enqueue_scripts, 3: login_enqueue_scripts */
    4445            __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
     
    4647            '<code>admin_enqueue_scripts</code>',
    4748            '<code>login_enqueue_scripts</code>'
    48         ), '3.3.0'
     49        ),
     50        '3.3.0'
    4951    );
    5052}
     
    112114    if ( false !== stripos( $data, '</script>' ) ) {
    113115        _doing_it_wrong(
    114             __FUNCTION__, sprintf(
     116            __FUNCTION__,
     117            sprintf(
    115118                /* translators: 1: <script>, 2: wp_add_inline_script() */
    116119                __( 'Do not pass %1$s tags to %2$s.' ),
    117120                '<code>&lt;script&gt;</code>',
    118121                '<code>wp_add_inline_script()</code>'
    119             ), '4.5.0'
     122            ),
     123            '4.5.0'
    120124        );
    121125        $data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );
Note: See TracChangeset for help on using the changeset viewer.