https://github.com/PressForward/pressforward
Revision ce83222a81bedcad4336d9ae344ef065076d58db authored by Boone B Gorges on 16 May 2023, 20:52:23 UTC, committed by Boone B Gorges on 16 May 2023, 20:52:23 UTC
1 parent 600aac7
Raw File
Tip revision: ce83222a81bedcad4336d9ae344ef065076d58db authored by Boone B Gorges on 16 May 2023, 20:52:23 UTC
Tested up to WP 6.2.
Tip revision: ce83222
phpcs.xml.dist
<?xml version="1.0"?>
<ruleset name="PressForward">
	<description>A custom set of PHPCS rules for PressForward PHP files.</description>

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

	<!-- Exclude any Node Modules directory. -->
	<exclude-pattern>/node_modules/*</exclude-pattern>

	<!-- Exclude Javascript and CSS files. -->
	<exclude-pattern>*.js</exclude-pattern>
	<exclude-pattern>*.css</exclude-pattern>

	<!-- Exclude test files. -->
	<exclude-pattern>/tests/</exclude-pattern>

	<!-- Misc files that are not loaded in production -->
	<exclude-pattern>Libraries/FiveFiltersReadability/examples/</exclude-pattern>
	<exclude-pattern>modules/foo</exclude-pattern>

	<!-- Do not scan built files. -->
	<exclude-pattern>/build/</exclude-pattern>

	<file>.</file>

	<!-- Check for PHP cross-version compatibility. -->
	<rule ref="PHPCompatibilityWP">
		<config name="testVersion" value="5.7-"/>
	</rule>

	<!-- Include the WordPress-Extra standard. -->
	<rule ref="WordPress">
		<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
		<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
		<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
		<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_tax_query" />
		<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_query" />
		<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_key" />
		<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_value" />

		<exclude-pattern>class-SplClassLoader.php</exclude-pattern>

		<!-- Third-party libraries don't need to be scanned for coding standards -->
		<exclude-pattern>Libraries/</exclude-pattern>
	</rule>

	<rule ref="WordPress.Security">
		<exclude name="WordPress.Security.NonceVerification" />
	</rule>

	<rule ref="WordPress.WP.DeprecatedClasses">
		<properties>
			<property name="minimum_supported_version" value="5.1"/>
		</properties>
	</rule>

	<rule ref="WordPress.WP.DeprecatedFunctions">
		<properties>
			<property name="minimum_supported_version" value="5.1"/>
		</properties>
	</rule>

	<rule ref="WordPress.WP.DeprecatedParameters">
		<properties>
			<property name="minimum_supported_version" value="5.1"/>
		</properties>
	</rule>

	<rule ref="WordPress.Utils.I18nTextDomainFixer">
		<properties>
			<property name="old_text_domain" type="array">
				<element value="old-text-domain"/>
				<element value="pf"/>
			</property>
			<property name="new_text_domain" value="pressforward" />
		</properties>
	</rule>

	<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
		<exclude-pattern>Controllers/PF_to_WP_Meta.php</exclude-pattern>
		<exclude-pattern>Controllers/PF_to_WP_Posts.php</exclude-pattern>
		<exclude-pattern>Controllers/PF_to_WP_System.php</exclude-pattern>
	</rule>

	<rule ref="Squiz.Commenting.FileComment.Missing">
		<exclude-pattern>pressforward.php</exclude-pattern>
	</rule>
</ruleset>
back to top