pantheon-systems/pantheon-wp-coding-standards

PHPCS Rulesets for WordPress projects on Pantheon.

Package info

github.com/pantheon-systems/Pantheon-WP-Coding-Standards

Type:phpcodesniffer-standard

pkg:composer/pantheon-systems/pantheon-wp-coding-standards

Statistics

Installs: 129 143

Dependents: 18

Suggesters: 0

Stars: 9

Open Issues: 0

3.0.1 2025-07-21 20:47 UTC

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 40a97fc4da4611f5f63f460211ff1e7d59b71f72

  • Pantheon <noreply.woop@pantheon.io>

README

👁 Actively Maintained
👁 Packagist Version
👁 MIT License

PHPCS rulesets for WordPress projects on Pantheon.

Setup

The PHPCS ruleset can be installed via Composer:

composer require --dev pantheon-systems/pantheon-wp-coding-standards

Usage

Run the following command to run the standards checks:

vendor/bin/phpcs -s --standard=Pantheon-WP .

We recommend using the -s flag so that PHPCS will report the specific rule that was violated. This makes it easier to add exclusions or research possible solutions.

If you have a tests directory that you want to exclude from the sniffs, you can do so by adding the --ignore flag:

vendor/bin/phpcs -s --ignore=tests/* --standard=Pantheon-WP .

Extending

If you want to customize the defaults or add additional rules, you can create your own standard file (e.g. phpcs.ruleset.xml):

<?xml version="1.0"?>
<ruleset>
	<!-- Files or directories to check -->
	<file>.</file>

	<!-- Include the Pantheon-WP ruleset -->
	<rule ref="Pantheon-WP" />

	<!-- Add additional rules here -->
	<rule ref="WordPress.WP.I18n">
		<properties>
			<property name="text_domain" value="my-plugin" />
		</properties>
</ruleset>

You can then reference this file when running PHPCS:

vendor/bin/phpcs -s --standard=phpcs.ruleset.xml .

Included Checks

The Pantheon WP standard is based upon WordPress Coding Standards, VIP Coding Standards with some customizations based on Human Made's Coding Standards.