[wp-trac] [WordPress Trac] #41057: Update PHP codebase per WordPress PHP Coding Standards

WordPress Trac noreply at wordpress.org
Thu Nov 23 07:00:50 UTC 2017


#41057: Update PHP codebase per WordPress PHP Coding Standards
----------------------------+-----------------------
 Reporter:  netweb          |       Owner:  pento
     Type:  task (blessed)  |      Status:  accepted
 Priority:  normal          |   Milestone:  5.0
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  early commit    |     Focuses:
----------------------------+-----------------------
Changes (by pento):

 * keywords:  early => early commit


Comment:

 In [attachment:phpcs.xml.6.dist]:

 - Exclude the `vendor` directory.
 - the config and config-sample files from the
 `Generic.Functions.FunctionCallArgumentSpacing` test. This allows the
 files to maintain the unorthodox (but imo, significantly nicer) spacing of
 the KEY/SALT constants.

 In order to more easily test with the latest PHPCS and WPCS, I've been
 using this `composer.json`, in case you're after an easy way to reproduce
 the current state of things:

 {{{
 {
         "require-dev": {
                 "dealerdirect/phpcodesniffer-composer-installer": "*",
                 "wp-coding-standards/wpcs": "dev-develop",
                 "squizlabs/php_codesniffer": "dev-master"
         }
 }
 }}}

 Despite there still being [https://github.com/WordPress-Coding-Standards
 /WordPress-Coding-
 Standards/issues?q=is%3Aopen+is%3Aissue+label%3A%22Project%3A+auto-
 fix+WP+Core+%2F+trac-41057%22 a handful of outstanding issues], I think
 this is good enough to commit. If you want to review the changes online,
 see [https://github.com/WordPress/wordpress-develop/pull/8 this PR].

 Prior to running `phpcbf`, `phpcs` reports 73201 errors and 21327 warnings
 in 1149 files (of a total of 1290 files scanned).

 After the `phpcbf` run, there are 3387 errors and 1606 warnings in 576
 files. It looks like all of these errors and warnings require manual
 fixing, which is definitely best done in followup commits.

 Unless there are show-stopping issues (minor formatting issues aren't
 show-stoppers, they can be reported to the [https://github.com/WordPress-
 Coding-Standards/WordPress-Coding-Standards/issues WPCS repo]), I'm
 planning on committing this early next week.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41057#comment:82>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list