Skip to content

Instantly share code, notes, and snippets.

@salcode salcode/.phpcs.xml.dist Secret
Last active Oct 15, 2018

What would you like to do?
WordPress phpcs.xml - modified version of the WordPress coding standards for PHP CodeSniffer
<?xml version="1.0"?>
<ruleset name="Iron Code Studio">
<description>The PHP CodeSniffer rules used by Sal Ferrarello (salcode) for his Iron Code Studio projects.</description>
You can download this file directly
to your project from the command-line with
curl -O
<!-- Exclude the Composer Vendor directory. -->
<!-- Exclude the Node Modules directory. -->
<!-- Exclude all Javascript files. -->
<!-- Exclude minified CSS file. -->
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra">
Example of removing a rule.
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfter"/>
<!-- Only enforce aligning assignment operators when difference is 2 or less. -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<property name="maxPadding" value="2" />
<!-- Do not follow WordPress class name naming requirements -->
<rule ref="WordPress.Files.FileName">
<property name="strict_class_file_names" value="false" />
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<property name="prefixes" type="array" value="fe_"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.