<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Gutenberg Coding Standards" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

	<description>The Coding standard for the Gutenberg Coding Standards itself.</description>

	<file>.</file>

	<!-- Exclude Composer vendor directory. -->
	<exclude-pattern>*/vendor/*</exclude-pattern>

	<!-- Only check PHP files. -->
	<arg name="extensions" value="php"/>

	<!-- Show progress, show the error codes for each message (source). -->
	<arg value="ps"/>

	<!-- Strip the filepaths down to the relevant bit. -->
	<arg name="basepath" value="."/>

	<!-- Check up to 8 files simultaneously. -->
	<arg name="parallel" value="8"/>

	<!--
	#############################################################################
	SET UP THE RULESETS
	#############################################################################
	-->

	<rule ref="WordPress">
		<!-- This project needs to comply with naming standards from PHPCS, not WP. -->
		<exclude name="WordPress.Files.FileName"/>
		<exclude name="WordPress.NamingConventions.ValidVariableName"/>
	</rule>

	<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing">
		<exclude-pattern>/PluginCheck/Tests/.+$</exclude-pattern>
	</rule>

	<!-- Check code for cross-version PHP compatibility. -->
	<config name="testVersion" value="7.4-"/>

	<!-- Enforce PSR1 compatible namespaces. -->
	<rule ref="PSR1.Classes.ClassDeclaration"/>
</ruleset>
