<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[43348] trunk: Build/Tools: Update PHPCS ruleset for WP Core and related Composer setup.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/43348">43348</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/43348","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>jrf</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-06-15 15:56:58 +0000 (Fri, 15 Jun 2018)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Build/Tools: Update PHPCS ruleset for WP Core and related Composer setup.
`.gitignore` + `svn:ignore`:
* Add the typical filenames of overloaded PHPCS configs to `.gitignore`.
Composer:
* Use the `develop` (Packagist `dev-master`) version of WPCS as it contains lots of bugfixes.
* Remove the PHPCS dependency. This is a dependency of WPCS, not of WP Core itself. This will also make sure that the PHPCS version used is always one which is supported by WPCS.
* Refreshed the `composer.lock` file.
PHPCS ruleset:
* Removed a reference to a sniff which doesn't exist in WPCS yet.
* Use the PHPCS 3.x `basepath` option to clean up the file paths PHPCS shows in the reports.
* Use the PHPCS 3.x `parallel` option to enable parallel scanning whenever possible to speed up the scans.
* Whitelist the `wp-includes/l10n.php` file from issues being reported by the `WordPress.WP.I18n` sniff.
Fixes <a href="https://core.trac.wordpress.org/ticket/44366">#44366</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkgitignore">trunk/.gitignore</a></li>
<li><a href="#trunkcomposerjson">trunk/composer.json</a></li>
<li><a href="#trunkcomposerlock">trunk/composer.lock</a></li>
<li><a href="#trunkphpcsxmldist">trunk/phpcs.xml.dist</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#trunk">trunk/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: trunk
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- trunk 2018-06-15 10:18:44 UTC (rev 43347)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ trunk 2018-06-15 15:56:58 UTC (rev 43348)
</ins><a id="trunk"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: trunk</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnignore"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:ignore</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> wp-config.php
</span><span class="cx" style="display: block; padding: 0 10px"> wp-tests-config.php
</span><span class="cx" style="display: block; padding: 0 10px"> .htaccess
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> # Files and folders related to build/test tools
</span><span class="cx" style="display: block; padding: 0 10px"> phpunit.xml
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+phpcs.xml
+.phpcs.xml
</ins><span class="cx" style="display: block; padding: 0 10px"> node_modules
</span><span class="cx" style="display: block; padding: 0 10px"> npm-debug.log
</span><span class="cx" style="display: block; padding: 0 10px"> build
</span><a id="trunkgitignore"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/.gitignore</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.gitignore 2018-06-15 10:18:44 UTC (rev 43347)
+++ trunk/.gitignore 2018-06-15 15:56:58 UTC (rev 43348)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,6 +7,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> # Files and folders related to build/test tools
</span><span class="cx" style="display: block; padding: 0 10px"> /phpunit.xml
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/.phpcs.xml
+/phpcs.xml
</ins><span class="cx" style="display: block; padding: 0 10px"> /tests/phpunit/data/plugins/wordpress-importer
</span><span class="cx" style="display: block; padding: 0 10px"> /tests/phpunit/data/.trac-ticket-cache*
</span><span class="cx" style="display: block; padding: 0 10px"> /tests/qunit/compiled.html
</span></span></pre></div>
<a id="trunkcomposerjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/composer.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/composer.json 2018-06-15 10:18:44 UTC (rev 43347)
+++ trunk/composer.json 2018-06-15 15:56:58 UTC (rev 43348)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,8 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "require-dev": {
</span><span class="cx" style="display: block; padding: 0 10px"> "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "squizlabs/php_codesniffer": "^3.2.3",
- "wp-coding-standards/wpcs": "dev-feature/new-multi-line-comment-formatting-sniffs"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "wp-coding-standards/wpcs": "dev-master"
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "scripts": {
</span><span class="cx" style="display: block; padding: 0 10px"> "format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
</span></span></pre></div>
<a id="trunkcomposerlock"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/composer.lock</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/composer.lock 2018-06-15 10:18:44 UTC (rev 43347)
+++ trunk/composer.lock 2018-06-15 15:56:58 UTC (rev 43348)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
</span><span class="cx" style="display: block; padding: 0 10px"> "This file is @generated automatically"
</span><span class="cx" style="display: block; padding: 0 10px"> ],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "content-hash": "4b409623b2bc5d8e87b7f45d57a60990",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "content-hash": "9c2c871b813e89682ef445611d2f5363",
</ins><span class="cx" style="display: block; padding: 0 10px"> "packages": [],
</span><span class="cx" style="display: block; padding: 0 10px"> "packages-dev": [
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,16 +77,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "name": "squizlabs/php_codesniffer",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": "3.2.3",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": "3.3.0",
</ins><span class="cx" style="display: block; padding: 0 10px"> "source": {
</span><span class="cx" style="display: block; padding: 0 10px"> "type": "git",
</span><span class="cx" style="display: block; padding: 0 10px"> "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "reference": "4842476c434e375f9d3182ff7b89059583aa8b27"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266"
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "dist": {
</span><span class="cx" style="display: block; padding: 0 10px"> "type": "zip",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4842476c434e375f9d3182ff7b89059583aa8b27",
- "reference": "4842476c434e375f9d3182ff7b89059583aa8b27",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
+ "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
</ins><span class="cx" style="display: block; padding: 0 10px"> "shasum": ""
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "require": {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,20 +124,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "phpcs",
</span><span class="cx" style="display: block; padding: 0 10px"> "standards"
</span><span class="cx" style="display: block; padding: 0 10px"> ],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "time": "2018-02-20T21:35:23+00:00"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "time": "2018-06-06T23:58:19+00:00"
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "name": "wp-coding-standards/wpcs",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": "dev-feature/new-multi-line-comment-formatting-sniffs",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": "dev-master",
</ins><span class="cx" style="display: block; padding: 0 10px"> "source": {
</span><span class="cx" style="display: block; padding: 0 10px"> "type": "git",
</span><span class="cx" style="display: block; padding: 0 10px"> "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "reference": "ce4d719296ebbecd01f57bc3729833e89b39ad99"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "reference": "cf6b310caad735816caef7573295f8a534374706"
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "dist": {
</span><span class="cx" style="display: block; padding: 0 10px"> "type": "zip",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/ce4d719296ebbecd01f57bc3729833e89b39ad99",
- "reference": "ce4d719296ebbecd01f57bc3729833e89b39ad99",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/cf6b310caad735816caef7573295f8a534374706",
+ "reference": "cf6b310caad735816caef7573295f8a534374706",
</ins><span class="cx" style="display: block; padding: 0 10px"> "shasum": ""
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "require": {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,7 +164,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "standards",
</span><span class="cx" style="display: block; padding: 0 10px"> "wordpress"
</span><span class="cx" style="display: block; padding: 0 10px"> ],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "time": "2017-11-30T18:28:51+00:00"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "time": "2018-02-16T01:57:48+00:00"
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ],
</span><span class="cx" style="display: block; padding: 0 10px"> "aliases": [],
</span></span></pre></div>
<a id="trunkphpcsxmldist"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/phpcs.xml.dist</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/phpcs.xml.dist 2018-06-15 10:18:44 UTC (rev 43347)
+++ trunk/phpcs.xml.dist 2018-06-15 15:56:58 UTC (rev 43348)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,10 +4,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <rule ref="WordPress-Core"/>
</span><span class="cx" style="display: block; padding: 0 10px"> <rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <rule ref="WordPress.Commenting.DocblockFormat"/>
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <arg name="extensions" value="php"/>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <!-- Strip the filepaths down to the relevant bit. -->
+ <arg name="basepath" value="./"/>
+
+ <!-- Check up to 20 files simultanously. -->
+ <arg name="parallel" value="20"/>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <!-- Show sniff codes in all reports -->
</span><span class="cx" style="display: block; padding: 0 10px"> <arg value="ps"/>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,6 +74,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <exclude-pattern>/tests/phpunit/tests/db\.php</exclude-pattern>
</span><span class="cx" style="display: block; padding: 0 10px"> </rule>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <!-- Whitelist the I18n functions file from issues identified by the I18n sniff
+ (such as calling the low-level translate() function). -->
+ <rule ref="WordPress.WP.I18n">
+ <exclude-pattern>/src/wp-includes/l10n\.php</exclude-pattern>
+ </rule>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <rule ref="Generic.Functions.FunctionCallArgumentSpacing">
</span><span class="cx" style="display: block; padding: 0 10px"> <exclude-pattern>/wp-config\.php</exclude-pattern>
</span><span class="cx" style="display: block; padding: 0 10px"> <exclude-pattern>/wp-config-sample\.php</exclude-pattern>
</span></span></pre>
</div>
</div>
</body>
</html>