godaddy-wordpress/go

View on GitHub
phpcs.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<ruleset name="go">
    <description>Rules for go</description>

    <arg name="extensions" value="php" />
    <arg name="basepath" value="./" />
    <file>./</file>

    <exclude-pattern>*/build/*</exclude-pattern>
    <exclude-pattern>*/dist/*</exclude-pattern>
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <exclude-pattern>*/node_modules/*</exclude-pattern>
    <exclude-pattern>*/wordpress*/*</exclude-pattern>
    <exclude-pattern>*/\.*</exclude-pattern>
    <exclude-pattern>*/.dev/*</exclude-pattern>

    <arg name="colors"/>
    <arg value="sp"/>

    <!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
    <arg name="cache" value="/tmp/phpcs-go-cache"/>

    <!-- Include the WordPress-Extra standard. -->
    <rule ref="WordPress-Extra">
        <!--
        We may want a middle ground though. The best way to do this is add the
        entire ruleset, then rule by rule, remove ones that don't suit a project.
        We can do this by running `phpcs` with the '-s' flag, which allows us to
        see the names of the sniffs reporting errors.
        Once we know the sniff names, we can opt to exclude sniffs which don't
        suit our project like so.
        -->
        <exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
        <exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
        <!--
        ShortPrefixPassed is excluded due to the use of prefix `Go` This prefix,
        while short in length, is approved by the themes team at WordPress.org.
        For this reason the rule should be excluded as we are not concerned with
        code collisions.
        -->
        <exclude name="WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed" />
    </rule>

    <!-- Let's also check that everything is properly documented. -->
    <rule ref="WordPress-Docs"/>

    <!-- Add in some extra rules from other standards. -->
    <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
    <rule ref="Generic.Commenting.Todo"/>

    <!-- Check for PHP cross-version compatibility. -->
    <config name="testVersion" value="5.6-"/>
    <rule ref="PHPCompatibilityWP"/>

    <!--
    To get the optimal benefits of using WPCS, we should add a couple of
    custom properties.
    Adjust the values of these properties to fit our needs.

    For information on additional custom properties available, check out
    the wiki:
    https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
    -->
    <config name="minimum_supported_wp_version" value="5.0.0"/>

    <rule ref="WordPress.WP.I18n">
        <properties>
            <property name="text_domain" value="go"/>
        </properties>
    </rule>

    <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
        <properties>
            <property name="prefixes" type="array">
                <element value="go"/>
            </property>
        </properties>
    </rule>

</ruleset>