automattic / vipwpcs
PHP_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions
Installs: 6 253 318
Dependents: 116
Suggesters: 0
Security: 0
Stars: 236
Watchers: 12
Forks: 40
Open Issues: 110
Type:phpcodesniffer-standard
Requires
- php: >=5.4
- phpcsstandards/phpcsextra: ^1.2.1
- phpcsstandards/phpcsutils: ^1.0.11
- sirbrillig/phpcs-variable-analysis: ^2.11.18
- squizlabs/php_codesniffer: ^3.9.2
- wp-coding-standards/wpcs: ^3.1.0
Requires (Dev)
- php-parallel-lint/php-console-highlighter: ^1.0.0
- php-parallel-lint/php-parallel-lint: ^1.3.2
- phpcompatibility/php-compatibility: ^9
- phpcsstandards/phpcsdevtools: ^1.0
- phpunit/phpunit: ^4 || ^5 || ^6 || ^7 || ^8 || ^9
- dev-develop
- 3.0.1
- 3.0.0
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.0.0
- 0.4.0
- 0.3.1
- 0.3.0
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- dev-feature/composer-no-lock
- dev-feature/ghactions-always-quote-variables
- dev-feature/docs-improve-specificity
- dev-rm/WordPress.Security.EscapeOutput.ExceptionNotEscaped
- dev-main
- dev-release/3.0.1
- dev-feature/soft-deprecate-sniffs-for-phpcs-4.0
- dev-options_race_sniff
- dev-rebecca/fix_113
- dev-rebecca/adjust_lowcacheexpirysniff
This package is auto-updated.
Last update: 2024-11-08 13:44:08 UTC
README
This project contains PHP_CodeSniffer (PHPCS) sniffs and rulesets to validate code developed for WordPress VIP.
This project contains two rulesets:
WordPressVIPMinimum
- for use with projects on the (older) WordPress.com VIP platform.WordPress-VIP-Go
- for use with projects on the (newer) VIP Go platform.
These rulesets contain only the rules which are considered to be errors and warnings according to the WordPress VIP documentation.
The rulesets use rules from the WordPress Coding Standards (WPCS) project, as well as the VariableAnalysis standard.
Learn about why violations are flagged as errors vs warnings and what the levels mean.
Minimal requirements
Installation
Composer will install the latest compatible versions of PHPCS, PHPCSUtils, PHPCSExtra, WPCS and VariableAnalysis and register the external standards with PHP_CodeSniffer.
Please refer to the installation instructions for installing PHP_CodeSniffer for WordPress VIP for more details.
As of VIPCS version 2.3.0, there is no need to require
the PHP_CodeSniffer Standards Composer Installer Plugin anymore as it is now a requirement of VIPCS itself. Permission to run the plugin will still need to be granted though when using Composer 2.2 or higher.
Composer Project-based Installation
To install the VIP Coding Standards, run the following from the root of your project:
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer require --dev automattic/vipwpcs
Composer Global Installation
Alternatively, it can be installed standard globally for use across multiple projects:
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --dev automattic/vipwpcs
Contribution
Please see CONTRIBUTION.md.
License
Licensed under GPL-2.0-or-later.