Skip to content

Commit

Permalink
Composer: add PHPCSExtra
Browse files Browse the repository at this point in the history
Add PHPCSExtra as a new dependency. PHPCSExtra is an external standard for PHP_CodeSniffer and is also a requirement for WPCS 3.0.0.

The reason to add it as a direct requirement for YoastCS is that we'll not only be using sniffs from PHPCSExtra via WPCS, but also want to use additional sniffs which PHPCSExtra has to offer, which makes it not just a requirement of WPCS, but also a requirement of YoastCS.

Ref: https://github.com/PHPCSStandards/PHPCSExtra
  • Loading branch information
jrfnl committed Nov 3, 2023
1 parent b075884 commit dbf537a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
run: >
composer require --no-update --no-scripts --no-interaction
squizlabs/php_codesniffer:"dev-master"
phpcsstandards/phpcsextra:"dev-develop"
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ The `Yoast` standard for PHP_CodeSniffer is comprised of the following:
* The `WordPress` ruleset from the [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards) implementing the official [WordPress PHP Coding Standards](https://make.wordpress.org/core/handbook/coding-standards/php/), with some [select exclusions](https://github.com/Yoast/yoastcs/blob/develop/Yoast/ruleset.xml#L29-L75).
* The [`PHPCompatibilityWP`](https://github.com/PHPCompatibility/PHPCompatibilityWP) ruleset which checks code for PHP cross-version compatibility while preventing false positives for functionality polyfilled within WordPress.
* Select additional sniffs taken from [`PHP_CodeSniffer`](https://github.com/squizlabs/PHP_CodeSniffer).
* Select additional sniffs taken from [`PHPCSExtra`](https://github.com/PHPCSStandards/PHPCSExtra).
* A number of custom Yoast specific sniffs.

Files within version management and dependency related directories, such as the Composer `vendor` directory, are excluded from the scans by default.
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"php-parallel-lint/php-console-highlighter": "^1.0.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/phpcompatibility-wp": "^2.1.4",
"phpcsstandards/phpcsextra": "^1.1.2",
"squizlabs/php_codesniffer": "^3.7.2",
"wp-coding-standards/wpcs": "^2.3.0"
},
Expand Down

0 comments on commit dbf537a

Please sign in to comment.