interactivestrategies / wordpress-cs
Custom Interactive Strategies code sniffer ruleset for WordPress projects.
dev-main
2024-11-19 18:28 UTC
Requires
- slevomat/coding-standard: ^8.11
- squizlabs/php_codesniffer: ^3.9.1
- wp-coding-standards/wpcs: 2.3.0
This package is not auto-updated.
Last update: 2025-05-03 18:18:26 UTC
README
This package defines customized Code Sniffer rules for WordPress projects. It is primarily based on WordPress , with some sniffs excluded and others downgraded to warnings. Some additional sniffs not provided have also been added.
Installing the ruleset
Use Composer to install the ruleset and its dependencies as a package:
composer require --dev interactivestrategies/wordpress-cs
Making the IS rules the default for your project
Add a phpcs.xml.dist file in your project with content like this(make sure to replace the path with the correct theme file name):
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="IS WordPress Standards">
<rule ref="ISWordPress"/>
<file>web/app/themes/emperor</file>
</ruleset>
The tag(s) define what paths the rules should be applied to/within.