Skip to content

Commit

Permalink
Merge pull request #1042 from Automattic/fix/update-dependencies
Browse files Browse the repository at this point in the history
Composer: Update dev-dependencies & consolidate PHPCS
  • Loading branch information
GaryJones authored May 21, 2024
2 parents 03800e2 + 23a10e3 commit b2777ba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
30 changes: 20 additions & 10 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>

<rule ref="WordPress-Extra" />
<rule ref="WordPress-Docs" />
<rule ref="WordPress-VIP-Go" />
<rule ref="WordPress">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
</rule>

<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- <rule ref="WordPress-Extra">--> <!-- Includes WordPress-Core -->
<!-- <exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />-->
<!-- </rule>-->
<!--<rule ref="WordPress-Docs"/>-->
<!-- For help in understanding this minimum_supported_wp_version:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#setting-minimum-supported-wp-version-for-all-sniffs-in-one-go-wpcs-0140 -->
<config name="minimum_supported_wp_version" value="5.9"/>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
Expand All @@ -17,18 +23,22 @@
</rule>

<rule ref="PHPCompatibilityWP"/>
<config name="testVersion" value="7.2-"/>

<arg name="extensions" value="php"/>
<config name="testVersion" value="7.4-"/>

<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- How to scan -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg value="n"/> <!-- No warnings -->
<arg name="colors"/> <!-- Show results with colors. Disable if working on Windows -->
<arg name="basepath" value="."/> <!-- Strip the file paths down to the relevant bit -->
<arg name="parallel" value="8"/> <!-- Enables parallel processing when available for faster results -->
<arg name="extensions" value="php"/> <!-- Limit to PHP files -->

<!-- Allow invoking just `phpcs` on command line without assuming STDIN for file input. -->
<file>.</file>

<exclude-pattern>*/dev-lib/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/dist/*</exclude-pattern>
</ruleset>
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@
"php": ">=7.4"
},
"require-dev": {
"automattic/vipwpcs": "^2.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7",
"automattic/vipwpcs": "^3",
"dms/phpunit-arraysubset-asserts": "^0.5.0",
"php-parallel-lint/php-parallel-lint": "^1.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.5",
"wp-cli/extension-command": "^2.0",
"wp-cli/wp-cli-tests": "^3",
"wp-coding-standards/wpcs": "^2.3.0",
"wp-cli/wp-cli-tests": "^v4",
"wp-coding-standards/wpcs": "^3.1",
"yoast/wp-test-utils": "^1.2"
},
"autoload": {
Expand All @@ -58,10 +56,10 @@
"@php ./vendor/bin/phpunit --exclude=ms-excluded"
],
"cs": [
"@php ./vendor/bin/phpcs -p -s -v -n . --standard=\"WordPress-VIP-Go\" --extensions=php --ignore=\"/vendor/*,/node_modules/*,/tests/*\""
"@php ./vendor/bin/phpcs"
],
"cbf": [
"@php ./vendor/bin/phpcbf -p -s -v -n . --standard=\"WordPress-VIP-Go\" --extensions=php --ignore=\"/vendor/*,/node_modules/*,/tests/*\""
"@php ./vendor/bin/phpcbf"
],
"lint": [
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git"
Expand Down

0 comments on commit b2777ba

Please sign in to comment.