From 4bfb0055e7981e47f346d288c3943af24802ed94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:46:49 +0100 Subject: [PATCH 1/2] qa: add test to verify php-cs-fixer is executed with checkstyle format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do want to have `php-cs-fixer` reporting to github pull requests. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- tests/code-check-phpcsfixer-php-dist/matrix.json | 2 +- tests/code-check-phpcsfixer-php/matrix.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/code-check-phpcsfixer-php-dist/matrix.json b/tests/code-check-phpcsfixer-php-dist/matrix.json index 18498a93..eea70486 100644 --- a/tests/code-check-phpcsfixer-php-dist/matrix.json +++ b/tests/code-check-phpcsfixer-php-dist/matrix.json @@ -2,7 +2,7 @@ "include": [ { "name": "PHP CS Fixer [7.4, latest]", - "job": "{\"command\":\"./vendor/bin/php-cs-fixer fix -v --diff --dry-run\",\"php\":\"7.4\",\"extensions\":[],\"ini\":[],\"dependencies\":\"latest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[],\"before_script\":[]}", + "job": "{\"command\":\"./vendor/bin/php-cs-fixer fix -v --diff --dry-run --format=checkstyle | cs2pr\",\"php\":\"7.4\",\"extensions\":[],\"ini\":[],\"dependencies\":\"latest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[],\"before_script\":[]}", "operatingSystem": "ubuntu-latest", "action": "laminas/laminas-continuous-integration-action@v1" } diff --git a/tests/code-check-phpcsfixer-php/matrix.json b/tests/code-check-phpcsfixer-php/matrix.json index 18498a93..eea70486 100644 --- a/tests/code-check-phpcsfixer-php/matrix.json +++ b/tests/code-check-phpcsfixer-php/matrix.json @@ -2,7 +2,7 @@ "include": [ { "name": "PHP CS Fixer [7.4, latest]", - "job": "{\"command\":\"./vendor/bin/php-cs-fixer fix -v --diff --dry-run\",\"php\":\"7.4\",\"extensions\":[],\"ini\":[],\"dependencies\":\"latest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[],\"before_script\":[]}", + "job": "{\"command\":\"./vendor/bin/php-cs-fixer fix -v --diff --dry-run --format=checkstyle | cs2pr\",\"php\":\"7.4\",\"extensions\":[],\"ini\":[],\"dependencies\":\"latest\",\"ignore_platform_reqs_8\":false,\"ignore_php_platform_requirement\":false,\"additional_composer_arguments\":[],\"before_script\":[]}", "operatingSystem": "ubuntu-latest", "action": "laminas/laminas-continuous-integration-action@v1" } From 6c6cccda72a907fb4c3eee45bddfc85ec1fecceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:47:23 +0100 Subject: [PATCH 2/2] feature: introduce `checkstyle` format for `php-cs-fixer` tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reports actual check output to github pull requests for integrated review. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- src/tools/phpCsFixer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/phpCsFixer.ts b/src/tools/phpCsFixer.ts index c67e854f..46892b7d 100644 --- a/src/tools/phpCsFixer.ts +++ b/src/tools/phpCsFixer.ts @@ -4,7 +4,7 @@ import {ToolExecutionType} from '../enum/toolExecutionType'; export const PhpCsFixerTool = { executionType : ToolExecutionType.STATIC, name : 'PHP CS Fixer', - command : './vendor/bin/php-cs-fixer fix -v --diff --dry-run', + command : './vendor/bin/php-cs-fixer fix -v --diff --dry-run --format=checkstyle | cs2pr', filesToCheck : [ '.php-cs-fixer.php', '.php-cs-fixer.dist.php' ], toolType : ToolType.CODE_CHECK, };