From 9ae8c78c5edada63aa404593ef911c70399cd9b2 Mon Sep 17 00:00:00 2001 From: Gary Jones Date: Mon, 29 Apr 2024 12:33:53 +0100 Subject: [PATCH 1/2] Composer: Update dev-dependencies --- composer.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index db73a114..57a05b22 100644 --- a/composer.json +++ b/composer.json @@ -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": { From 23a10e36b76fbb2097dcd100befbf922e3d2049e Mon Sep 17 00:00:00 2001 From: Gary Jones Date: Mon, 29 Apr 2024 12:45:29 +0100 Subject: [PATCH 2/2] PHPCS: Consolidate config into config file The PHPCS in the composer.json was duplicating but obscuring some aspects of what was in the `phpcs.xml.dist` file. This change consolidates the Composer commands and the config file. --- .phpcs.xml.dist | 30 ++++++++++++++++++++---------- composer.json | 4 ++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index af71a3db..4759537c 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -2,12 +2,18 @@ Generally-applicable sniffs for WordPress plugins - - - - - + + + + + + + + + @@ -17,12 +23,15 @@ - - - + - - + + + + + + + . @@ -30,5 +39,6 @@ */dev-lib/* */node_modules/* */vendor/* + */tests/* */dist/* diff --git a/composer.json b/composer.json index 57a05b22..b1ad7c22 100644 --- a/composer.json +++ b/composer.json @@ -56,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"