diff options
Diffstat (limited to 'phpcs.xml.dist')
| -rw-r--r-- | phpcs.xml.dist | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..8bdc1e5 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<ruleset name="cepis-woocommerce"> + <description>WordPress coding standards for the plugin's own code.</description> + + <file>.</file> + + <exclude-pattern>/node_modules/*</exclude-pattern> + <exclude-pattern>/dist/*</exclude-pattern> + <exclude-pattern>/vendor/*</exclude-pattern> + + <!-- + The bundled client is PSR-12 upstream and is copied in verbatim by + tools/update-vendor.sh. Reformatting it here would make every refresh a + merge conflict. + --> + <exclude-pattern>/lib/cepis/*</exclude-pattern> + + <arg name="extensions" value="php"/> + <arg name="basepath" value="."/> + <arg name="colors"/> + <arg value="sp"/> + + <rule ref="WordPress"> + <exclude name="WordPress.Files.FileName.InvalidClassFileName"/> + </rule> + + <config name="minimum_wp_version" value="6.9"/> + + <rule ref="WordPress.WP.I18n"> + <properties> + <property name="text_domain" type="array"> + <element value="cepis-woocommerce"/> + </property> + </properties> + </rule> + + <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> + <properties> + <property name="prefixes" type="array"> + <element value="cepis_woo"/> + <element value="Cepis_Woo"/> + <element value="CEPIS_WOO"/> + <element value="cepis_woocommerce"/> + </property> + </properties> + </rule> + + <!-- + Properties of the bundled client, which is English camelCase by design + and is not this plugin's to rename. + --> + <rule ref="WordPress.NamingConventions.ValidVariableName"> + <properties> + <property name="allowed_custom_properties" type="array"> + <element value="retryAfter"/> + <element value="baseUrl"/> + <element value="userAgent"/> + </property> + </properties> + </rule> + + <rule ref="WordPress.WP.Capabilities"> + <properties> + <property name="custom_capabilities" type="array"> + <element value="manage_woocommerce"/> + </property> + </properties> + </rule> + + <!-- + Both files delete transients by prefix, and WordPress has no API for + that: `delete_transient()` needs the exact key. The query is prepared + and the result is fed straight back into `delete_transient()`, so the + caching the sniff asks for is the very thing being cleared. + --> + <rule ref="WordPress.DB.DirectDatabaseQuery"> + <exclude-pattern>/uninstall.php</exclude-pattern> + <exclude-pattern>/includes/class-cepis-woo-lookup.php</exclude-pattern> + </rule> +</ruleset> |