42 lines
1.5 KiB
XML
42 lines
1.5 KiB
XML
<?xml version="1.0"?>
|
|
<ruleset name="Custom PHPCS Ruleset">
|
|
<description>PHPCodeSniffer configuration for PHP code analysis.</description>
|
|
|
|
<!-- Path to analyze -->
|
|
<file>src</file>
|
|
|
|
<!-- Display progress (-p), show sniff codes on violations (-s), and colorize output -->
|
|
<arg value="p"/>
|
|
<arg value="s"/>
|
|
<arg name="colors"/>
|
|
|
|
<!-- Set standard coding standard (PSR-12) -->
|
|
<rule ref="PSR12">
|
|
<!-- Disable PSR-12 rules forcing opening braces onto a new line -->
|
|
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
|
|
<exclude name="PSR12.Classes.OpeningBraceSpace.Found"/>
|
|
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine"/>
|
|
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
|
|
</rule>
|
|
|
|
<!-- Require opening braces to be on the same line (1TBS / K&R style) -->
|
|
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
|
|
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
|
|
|
|
<!-- Enforce 2-space indentation instead of 4 -->
|
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
|
<properties>
|
|
<property name="indent" value="2"/>
|
|
<property name="exact" value="true"/>
|
|
</properties>
|
|
</rule>
|
|
|
|
<!-- Exclude third-party vendor files and node_modules -->
|
|
<exclude-pattern>*/vendor/*</exclude-pattern>
|
|
<exclude-pattern>*/node_modules/*</exclude-pattern>
|
|
|
|
<!-- Cache results locally to speed up subsequent runs -->
|
|
<arg name="cache" value=".phpcs.cache"/>
|
|
</ruleset>
|
|
|