This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/phpcs.xml

93 lines
2.7 KiB
XML
Raw Permalink Normal View History

2017-01-26 18:15:24 +00:00
<?xml version="1.0"?>
2019-07-04 14:51:13 +00:00
<ruleset name="UnderStrap Coding Standards">
2017-01-26 18:15:24 +00:00
<description>Apply WordPress Coding Standards to UnderStrap</description>
<!-- Only scan PHP files. -->
<arg name="extensions" value="php"/>
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
2019-07-04 14:51:13 +00:00
<!-- Show colors in console -->
<arg value="-colors"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Don't show warnings -->
<arg value="n"/>
2017-01-26 18:15:24 +00:00
2019-06-26 16:33:58 +00:00
<!-- Scan these files -->
<file>.</file>
<!-- Directories and third party library exclusions. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/dist/*</exclude-pattern>
2019-06-26 16:33:58 +00:00
2019-07-04 14:51:13 +00:00
<!-- Use the WordPress Ruleset -->
<rule ref="WordPress"/>
2017-08-14 14:30:16 +00:00
2019-07-04 14:51:13 +00:00
<!--
Verify that the text_domain is set to the desired text-domain.
Multiple valid text domains can be provided as a comma-delimited list.
-->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="understrap"/>
</properties>
2017-01-26 18:15:24 +00:00
</rule>
2019-07-04 14:51:13 +00:00
<!--
Allow for theme specific exceptions to the file name rules based
on the theme hierarchy.
-->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true"/>
</properties>
2017-08-14 14:30:16 +00:00
</rule>
<!-- Assignments in while conditions are a valid method of looping over iterables. -->
<rule ref="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Exclude incorrectly named files that won't be renamed. -->
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>/inc/class-wp-bootstrap-navwalker\.php</exclude-pattern>
</rule>
<rule ref="WordPress.Security.EscapeOutput">
<!-- Exclude functions which are escaped in inc/extras.php -->
<properties>
<property name="customAutoEscapedFunctions" type="array">
<element value="get_the_title"/>
<element value="get_the_archive_title"/>
<element value="get_the_archive_description"/>
</property>
</properties>
</rule>
<!--
Exclude checking of line endings when reporting errors, but fix them
when running phpcbf.
-->
<rule ref="Generic.Files.LineEndings">
<exclude phpcs-only="true" name="Generic.Files.LineEndings"/>
</rule>
2019-07-04 14:51:13 +00:00
<!-- A closing tag is not permitted at the end of a PHP file -->
<rule ref="Zend.Files.ClosingTag"/>
2019-07-04 14:51:13 +00:00
<!-- Use the PHPCompatibility Ruleset -->
<config name="testVersion" value="5.6-99.0"/>
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
2017-08-14 14:30:16 +00:00
</rule>
2017-01-26 18:15:24 +00:00
</ruleset>