<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
	<description>Generally-applicable sniffs for WordPress plugins.</description>

	<!-- What to scan -->
	<file>.</file>
	<exclude-pattern>/vendor/*</exclude-pattern>
	<exclude-pattern>/node_modules/*</exclude-pattern>
	<exclude-pattern>/dist/*</exclude-pattern>
	<exclude-pattern>/languages/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-helpers/package/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/tgm-plugin-activation/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-blocks-pro/plugin-update-checker/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/font-awesome/package/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-css-optimize/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-swiper/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-components/package/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-customize-helpers/package/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-admin/package/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/term-color/package/*</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-blocks/build/block-build.asset.php</exclude-pattern>
	<exclude-pattern type="relative">^inc/vk-blocks/build/admin-build.asset.php</exclude-pattern>
	<exclude-pattern type="relative">^test/phpunit/*</exclude-pattern>
	<exclude-pattern type="relative">^tests/*</exclude-pattern>
	<exclude-pattern type="relative">^.git/*</exclude-pattern>
	<exclude-pattern type="relative">^build/*</exclude-pattern>
	<exclude-pattern type="relative">^temp/*</exclude-pattern>

	<!-- How to scan -->
	<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
	<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
	<arg value="sp"/> <!-- Show sniff and progress -->
	<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
	<arg name="colors"/>
	<arg name="extensions" value="php"/>
	<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->

	<!-- Rules: Check PHP version compatibility -->
	<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
	<config name="testVersion" value="5.3-"/>
	<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
	<rule ref="PHPCompatibilityWP"/>

	<!-- Include the WordPress-Extra standard. -->
	<rule ref="WordPress-Extra">
		<!--
		We may want a middle ground though. The best way to do this is add the
		entire ruleset, then rule by rule, remove ones that don't suit a project.
		We can do this by running `phpcs` with the '-s' flag, which allows us to
		see the names of the sniffs reporting errors.
		Once we know the sniff names, we can opt to exclude sniffs which don't
		suit our project like so.

		The below two examples just show how you can exclude rules.
		They are not intended as advice about which sniffs to exclude.
		-->

		<!--
		<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/>
		<exclude name="WordPress.Security.EscapeOutput"/>
		-->
	</rule>
	
	<!-- Let's also check that everything is properly documented. -->
	<rule ref="WordPress-Docs"/>

	<config name="minimum_supported_wp_version" value="4.6"/>
	<config name="ignore_warnings_on_exit" value="1" />

	<rule ref="WordPress">
		<!-- array()を[]で書いてもOKとする -->
		<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/>
		<!-- 一行コメントの末尾.のチェックを外す -->
		<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
		<!-- PSR-4 namespaces are vendor-style; ignore WPCS namespace prefix check. -->
		<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound"/>
	</rule>

	<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
		<properties>
			<!-- Value: replace the function, class, and variable prefixes used. Use <element> nodes for arrays. -->
			<property name="prefixes" type="array">
				<element value="vkfav"/>
				<element value="vkfa"/>
				<element value="vk"/>
				<element value="vk_font_awesome"/>
			</property>
		</properties>
	</rule>
	<rule ref="WordPress.WP.I18n">
		<properties>
			<!-- Value: replace the text domain used. Use <element> nodes for arrays. -->
			<property name="text_domain" type="array">
				<element value="font-awesome-versions"/>
			</property>
		</properties>
	</rule>
	<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
		<properties>
			<property name="blank_line_check" value="true"/>
		</properties>
	</rule>
</ruleset>
