Skip to content
Permalink
Browse files

Build/Test Tools: Move Composer script command line directives to the…

… PHPCS ruleset.

Also, move all arguments up to the top of the custom ruleset to make it easier to understand the conditions the ruleset is run under.

Props desrosj, jrf.
See #46152.

git-svn-id: https://develop.svn.wordpress.org/trunk@46291 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed Sep 25, 2019
1 parent 3369608 commit 2dbc7e087fe0f876085a7d519d5dc261f1a7e2af
Showing with 25 additions and 15 deletions.
  1. +2 −2 composer.json
  2. +23 −13 phpcs.xml.dist
@@ -19,8 +19,8 @@
},
"scripts": {
"compat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcompat.xml.dist --report=summary,source",
"format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source --cache -d memory_limit=256M",
"lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary,source --cache -d memory_limit=256M",
"format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source",
"lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary,source",
"lint:errors": "@lint -n"
}
}
@@ -2,6 +2,29 @@
<ruleset name="WordPress Coding Standards">
<description>Apply WordPress Coding Standards to all Core files</description>

<!-- Only scan PHP files. -->
<arg name="extensions" value="php"/>

<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache"/>

<!-- Set the memory limit to 256M.
For most standard PHP configurations, this means the memory limit will temporarily be raised.
Ref: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#specifying-phpini-settings
-->
<ini name="memory_limit" value="256M"/>

<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>

<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20"/>

<!-- Show sniff codes in all reports -->
<arg value="ps"/>

<file>.</file>

<rule ref="WordPress-Core"/>
<rule ref="WordPress.CodeAnalysis.EmptyStatement"/>

@@ -76,19 +99,6 @@
</properties>
</rule>

<arg name="extensions" value="php"/>

<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>

<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20"/>

<!-- Show sniff codes in all reports -->
<arg value="ps"/>

<file>.</file>

<!-- Exclude the build folder in the current directory, as Travis puts the checkout in a build directory. -->
<exclude-pattern type="relative">^build/*</exclude-pattern>

0 comments on commit 2dbc7e0

Please sign in to comment.
You can’t perform that action at this time.