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
This commit is contained in:
parent
336960897d
commit
2dbc7e087f
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user