Skip to content

Instantly share code, notes, and snippets.

@eliot-akira
Last active November 1, 2019 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliot-akira/80f1837be0c1c9c94850ee17257fa336 to your computer and use it in GitHub Desktop.
Save eliot-akira/80f1837be0c1c9c94850ee17257fa336 to your computer and use it in GitHub Desktop.
WordPress code standard with 2-space indent
<?xml version="1.0"?>
<ruleset name="MyStandard" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>WordPress code standard with 2-space indent.</description>
<rule ref="WordPress">
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
<exclude name="PEAR.Functions.FunctionCallSignature.Indent"/>
<exclude name="WordPress.Arrays.ArrayIndentation"/>
<exclude name="WordPress.WhiteSpace.PrecisionAlignment"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
<property name="ignoreIndentationTokens" type="array">
<element value="T_HEREDOC"/>
<element value="T_NOWDOC"/>
<element value="T_INLINE_HTML"/>
</property>
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="WordPress.Arrays.ArrayIndentation">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.PrecisionAlignment">
<properties>
<property name="tabWidth" value="2"/>
</properties>
</rule>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment