Skip to content

Commit

Permalink
Ruleset: various tweaks for PHP-Code-Style 2.0
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
jrfnl authored and grogy committed Dec 20, 2021
1 parent 84854c3 commit 9fe669b
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
<?xml version="1.0"?>
<ruleset name="Jakub Onderka Coding Standard">
<ruleset name="PHP-Console-Color">
<description>A coding standard for Jakub Onderka's projects.</description>

<file>./src/</file>
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->

<!-- Scan all files. -->
<file>.</file>

<!-- Exclude dependencies and auto-generated files. -->
<exclude-pattern>*/build/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>

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

<rule ref="./vendor/php-parallel-lint/php-code-style/ruleset.xml"/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>


<!--
#############################################################################
USE THE PHPParallelLint RULESET
#############################################################################
-->

<!-- Set the supported PHP versions for PHPCompatibility (included in PHPParallelLint). -->
<config name="testVersion" value="5.3-"/>

<rule ref="PHPParallelLint"/>

</ruleset>

0 comments on commit 9fe669b

Please sign in to comment.