.phpcs.xml.dist 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. <!-- What to scan -->
  5. <file>.</file>
  6. <exclude-pattern>/vendor/</exclude-pattern>
  7. <exclude-pattern>/node_modules/</exclude-pattern>
  8. <!-- How to scan -->
  9. <!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
  10. <!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
  11. <arg value="sp"/> <!-- Show sniff and progress -->
  12. <arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
  13. <arg name="colors"/>
  14. <arg name="extensions" value="php"/>
  15. <arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->
  16. <!-- Rules: Check PHP version compatibility -->
  17. <!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
  18. <config name="testVersion" value="5.3-"/>
  19. <!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
  20. <rule ref="PHPCompatibilityWP"/>
  21. <!-- Rules: WordPress Coding Standards -->
  22. <!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
  23. <!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
  24. <config name="minimum_supported_wp_version" value="4.6"/>
  25. <rule ref="WordPress">
  26. <exclude name="WordPress.VIP"/>
  27. </rule>
  28. <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
  29. <properties>
  30. <!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
  31. <property name="prefixes" type="array" value="my-plugin"/>
  32. </properties>
  33. </rule>
  34. <rule ref="WordPress.WP.I18n">
  35. <properties>
  36. <!-- Value: replace the text domain used. -->
  37. <property name="text_domain" type="array" value="my-plugin"/>
  38. </properties>
  39. </rule>
  40. <rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
  41. <properties>
  42. <property name="blank_line_check" value="true"/>
  43. </properties>
  44. </rule>
  45. </ruleset>