Skip to content

Commit 9fe669b

Browse files
jrfnlgrogy
authored andcommitted
Ruleset: various tweaks for PHP-Code-Style 2.0
* Scan all PHP files, not just the file in `src` for improved consistency across the code base, but exclude the `vendor` and the `build` (code coverage) directories. * Enable parallel scanning for faster results. * Use the ruleset from PHP-Code-Style by name. * Set the `testVersion` for use with PHPCompatibility. * Include minimal documentation in the ruleset.
1 parent 84854c3 commit 9fe669b

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

phpcs.xml.dist

+28-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
<?xml version="1.0"?>
2-
<ruleset name="Jakub Onderka Coding Standard">
2+
<ruleset name="PHP-Console-Color">
33
<description>A coding standard for Jakub Onderka's projects.</description>
44

5-
<file>./src/</file>
5+
<!--
6+
#############################################################################
7+
COMMAND LINE ARGUMENTS
8+
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
9+
#############################################################################
10+
-->
11+
12+
<!-- Scan all files. -->
13+
<file>.</file>
14+
15+
<!-- Exclude dependencies and auto-generated files. -->
16+
<exclude-pattern>*/build/*</exclude-pattern>
17+
<exclude-pattern>*/vendor/*</exclude-pattern>
618

719
<!-- Only check PHP files. -->
820
<arg name="extensions" value="php"/>
@@ -13,6 +25,19 @@
1325
<!-- Strip the filepaths down to the relevant bit. -->
1426
<arg name="basepath" value="./"/>
1527

16-
<rule ref="./vendor/php-parallel-lint/php-code-style/ruleset.xml"/>
28+
<!-- Check up to 8 files simultaneously. -->
29+
<arg name="parallel" value="8"/>
30+
31+
32+
<!--
33+
#############################################################################
34+
USE THE PHPParallelLint RULESET
35+
#############################################################################
36+
-->
37+
38+
<!-- Set the supported PHP versions for PHPCompatibility (included in PHPParallelLint). -->
39+
<config name="testVersion" value="5.3-"/>
40+
41+
<rule ref="PHPParallelLint"/>
1742

1843
</ruleset>

0 commit comments

Comments
 (0)