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-admin/includes/class-theme-upgrader.php

    r42871 r43571  
    112112        // We don't have the parent theme, let's install it.
    113113        $api = themes_api(
    114             'theme_information', array(
     114            'theme_information',
     115            array(
    115116                'slug'   => $theme_info->get( 'Template' ),
    116117                'fields' => array(
     
    419420        /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
    420421        do_action(
    421             'upgrader_process_complete', $this, array(
     422            'upgrader_process_complete',
     423            $this,
     424            array(
    422425                'action' => 'update',
    423426                'type'   => 'theme',
     
    469472        if ( ! file_exists( $working_directory . 'style.css' ) ) {
    470473            return new WP_Error(
    471                 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'],
     474                'incompatible_archive_theme_no_style',
     475                $this->strings['incompatible_archive'],
    472476                /* translators: %s: style.css */
    473477                sprintf(
     
    479483
    480484        $info = get_file_data(
    481             $working_directory . 'style.css', array(
     485            $working_directory . 'style.css',
     486            array(
    482487                'Name'     => 'Theme Name',
    483488                'Template' => 'Template',
     
    487492        if ( empty( $info['Name'] ) ) {
    488493            return new WP_Error(
    489                 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'],
     494                'incompatible_archive_theme_no_name',
     495                $this->strings['incompatible_archive'],
    490496                /* translators: %s: style.css */
    491497                sprintf(
     
    499505        if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) {
    500506            return new WP_Error(
    501                 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'],
     507                'incompatible_archive_theme_no_index',
     508                $this->strings['incompatible_archive'],
    502509                /* translators: %s: index.php */
    503510                sprintf(
Note: See TracChangeset for help on using the changeset viewer.