|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset name="WordPress Coding Standards based custom ruleset for your plugin"> |
| 3 | + <description>Generally-applicable sniffs for WordPress plugins.</description> |
| 4 | + |
| 5 | + <!-- What to scan --> |
| 6 | + <file>.</file> |
| 7 | + <exclude-pattern>/vendor/</exclude-pattern> |
| 8 | + <exclude-pattern>/node_modules/</exclude-pattern> |
| 9 | + <exclude-pattern>/tests/*</exclude-pattern> |
| 10 | + |
| 11 | + <!-- How to scan --> |
| 12 | + <!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> |
| 13 | + <!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> |
| 14 | + <arg value="sp"/> <!-- Show sniff and progress --> |
| 15 | + <arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit --> |
| 16 | + <arg name="colors"/> |
| 17 | + <arg name="extensions" value="php"/> |
| 18 | + <arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. --> |
| 19 | + |
| 20 | + <!-- Rules: Check PHP version compatibility --> |
| 21 | + <!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> |
| 22 | + <config name="testVersion" value="7.2-"/> |
| 23 | + <!-- https://github.com/PHPCompatibility/PHPCompatibilityWP --> |
| 24 | + <rule ref="PHPCompatibilityWP"/> |
| 25 | + |
| 26 | + <!-- Rules: WordPress Coding Standards --> |
| 27 | + <!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards --> |
| 28 | + <!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties --> |
| 29 | + <config name="minimum_supported_wp_version" value="4.6"/> |
| 30 | + <rule ref="WordPress"> |
| 31 | + <!-- Unable to fix --> |
| 32 | + <exclude name="WordPress.Files.FileName.InvalidClassFileName"/> |
| 33 | + <exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound"/> |
| 34 | + <exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound"/> |
| 35 | + <exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/> |
| 36 | + |
| 37 | + <!-- TODO: Maybe fix --> |
| 38 | + <exclude name="WordPress.WP.CronInterval.ChangeDetected"/> |
| 39 | + <exclude name="WordPress.WP.AlternativeFunctions.rand_rand"/> |
| 40 | + <exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/> |
| 41 | + |
| 42 | + <!-- TODO: Should fix --> |
| 43 | + <exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared"/> |
| 44 | + <exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/> |
| 45 | + <exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments"/> |
| 46 | + <exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/> |
| 47 | + <exclude name="Generic.Commenting.DocComment.SpacingAfter"/> |
| 48 | + </rule> |
| 49 | + <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> |
| 50 | + <properties> |
| 51 | + <!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. --> |
| 52 | + <property name="prefixes" type="array" value="wpbp"/> |
| 53 | + </properties> |
| 54 | + |
| 55 | + <!-- TODO: Maybe fix --> |
| 56 | + <exclude name="WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound"/> |
| 57 | + </rule> |
| 58 | + <rule ref="WordPress.WP.I18n"> |
| 59 | + <properties> |
| 60 | + <!-- Value: replace the text domain used. --> |
| 61 | + <property name="text_domain" type="array" value="wp-background-processing"/> |
| 62 | + </properties> |
| 63 | + |
| 64 | + <!-- TODO: Should fix --> |
| 65 | + <exclude name="WordPress.WP.I18n.MissingArgDomain"/> |
| 66 | + <exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/> |
| 67 | + </rule> |
| 68 | + <rule ref="WordPress.WhiteSpace.ControlStructureSpacing"> |
| 69 | + <properties> |
| 70 | + <property name="blank_line_check" value="true"/> |
| 71 | + </properties> |
| 72 | + </rule> |
| 73 | +</ruleset> |
0 commit comments