<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>
<!-- What to scan -->
<file>.</file>
<!-- Exclude built assets -->
<exclude-pattern>/build/</exclude-pattern>
<!-- Exclude node_modules -->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<!-- Exclude tests -->
<exclude-pattern>/tests/</exclude-pattern>
<!-- Exclude vendor directories -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>/wp-includes</exclude-pattern>
<exclude-pattern>scoper.inc.php</exclude-pattern>
<!-- Colors! Nice! -->
<arg name="colors"/>
<!--- Only check PHP files -->
<arg name="extensions" value="php"/>
<!-- Commandline options for PHPCS -->
<arg value="s"/>
<arg value="n"/>
<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<!-- <config name="testVersion" value="7.0-"/> -->
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<!-- <rule ref="PHPCompatibilityWP"/> -->
<rule ref="Squiz.PHP.Eval"/>
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="5.0"/>
<rule ref="WordPress">
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
</rule>
<rule ref="WordPress-Docs" />
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="a_z_listing,the_a_z_listing,have_a_z_,get_the_a_z,get_the_az,the_a_z,the_az"/>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="a-z-listing"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="-"/>
</properties>
</rule>
</ruleset>
I've tried using the beta docker image of
codeclimate-phpcodesnifferto get access to a more recentphpcsbuild than is in stable. (I need access to disabling specific sniffs on a single line as documented at https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file. The inline// phpcs:ignoreform is only available in phpcs since version 3.2.0, where the stable docker image by codeclimate is still on 2.9.1.When I run the beta docker image I am greeted with the following log showing that the container is missing the
php7-xmlreaderpackage from the Alpine repository.Log of execution
My `.codeclimate` file
My `.phpcs.dist.xml` file