<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
    <description>WordPress Coding Standards ruleset</description>

    <file>.</file>

    <!-- Exclude paths -->
    <exclude-pattern>/vendor/</exclude-pattern>
    <exclude-pattern>/languages/</exclude-pattern>
    <exclude-pattern>*.js</exclude-pattern>

    <!-- Show progress, show the error codes for each message (source) -->
    <arg value="ps" />

    <!-- Strip the filepaths down to the relevant bit. -->
	<arg name="basepath" value="."/>

    <!-- Check up to 8 files simultaneously -->
    <arg name="parallel" value="8" />

    <config name="minimum_wp_version" value="6.6"/>

    <!-- Let's also check that everything is properly documented. -->
	<rule ref="WordPress-Docs"/>

	<!-- Add in some extra rules from other standards. -->
	<rule ref="Generic.Commenting.Todo"/>

    <!-- Include the WordPress-Core standard -->
    <rule ref="WordPress-Core">
        <exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
        <exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
        <exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase" />
        <exclude name="WordPress.PHP.DisallowShortTernary.Found" />
        <exclude name="WordPress.PHP.YodaConditions" />
        <exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared" />
        <exclude name="Squiz.Commenting.FileComment.Missing" />
        <exclude name="Universal.Operators.DisallowShortTernary.Found" />
    </rule>

    <!--
    <rule ref="WordPress-Extra">
    </rule>
    -->

    <rule ref="Internal.NoCodeFound">
        <severity>0</severity>
    </rule>

    <rule ref="Generic.WhiteSpace.ScopeIndent">
        <properties>
            <property name="indent" value="4" />
            <property name="tabIndent" value="false" />
        </properties>
    </rule>
    <rule ref="Generic.WhiteSpace.DisallowTabIndent" />

    <!-- Allow short syntax arrays. -->
    <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>

    <!-- Disallow long array syntax -->
    <rule ref="Generic.Arrays.DisallowShortArraySyntax.Found">
        <exclude-pattern>*</exclude-pattern>
    </rule>
    <rule ref="Universal.Arrays.DisallowShortArraySyntax.Found">
        <exclude-pattern>*</exclude-pattern>
    </rule>
</ruleset>
