<?xml version="1.0"?>
<!--
	Customize the rules WP Enforcer uses by editing this file according to PHP_CodeSniffer's
	ruleset.xml standard: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
-->
<ruleset name="WP-Enforcer">
	<description>Coding standards from WP Enforcer.</description>

	<!-- FILES -->

	<exclude-pattern>*/tests/*</exclude-pattern>
	<exclude-pattern>*/vendor/*</exclude-pattern>
	<exclude-pattern>*/images/*</exclude-pattern>

	<!-- Commenting Sniffs -->

	<!-- Detect "fixme" comments and warn -->
	<rule ref="Generic.Commenting.Fixme" />
	<!-- Detect "todo" comments and warn -->
	<rule ref="Generic.Commenting.Todo" />

	<!-- @todo Doc me -->
	<rule ref="PEAR.Commenting.ClassComment" />
	<!-- @todo Doc me -->
	<rule ref="PEAR.Commenting.FunctionComment.Missing" />
	<!-- Block comments should be used appropriately -->
	<rule ref="Squiz.Commenting.BlockComment" />
	<!-- Class comment blocks -->
	<rule ref="Squiz.Commenting.ClassComment" />
	<!-- Tests that the stars in a doc comment align correctly. -->
	<rule ref="Squiz.Commenting.DocCommentAlignment" />
	<!-- Ensures CATCH clause must at least have a comment -->
	<rule ref="Squiz.Commenting.EmptyCatchComment" />
	<!-- File comment blocks -->
	<rule ref="Squiz.Commenting.FileComment" />
	<!-- Function comment blocks -->
	<rule ref="Squiz.Commenting.FunctionComment" />
	<!-- Do not test scalar typehint (php-7 only feature) -->
	<rule ref="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing">
		<severity>0</severity>
	</rule>
	<!-- Verifies that a @throws tag exists for a function that throws exceptions -->
	<rule ref="Squiz.Commenting.FunctionCommentThrowTag" />
	<!-- Checks that there is adequate spacing between comments -->
	<rule ref="Squiz.Commenting.InlineComment" />
	<!-- Checks to ensure that there are no comments after statements (on same line, after ;) -->
	<rule ref="Squiz.Commenting.PostStatementComment" />
	<!-- Variable commenting rules -->
	<rule ref="Squiz.Commenting.VariableComment" />

	<!--
		Don't get angry about checking files that don't contain code
		@link https://github.com/stevegrunwell/wp-enforcer/issues/12
	-->
	<rule ref="Internal.NoCodeFound">
		<severity>0</severity>
	</rule>

	<rule ref="WordPress-VIP">
		<exclude name="WordPress.VIP.SuperGlobalInputUsage" />
	</rule>
	<rule ref="WordPress-Docs" />
</ruleset>