From a7e0286e1826726795e654252477c7ab5b6b431a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 17 May 2024 13:09:32 +0200 Subject: [PATCH 1/4] Output PHP_CodeSniffer autofix diff in CI --- .github/workflows/coding-standards.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 1fa781f..f777c41 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -54,3 +54,9 @@ jobs: # https://github.com/doctrine/.github/issues/3 - name: "Run PHP_CodeSniffer" run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr" + + - name: "Output PHP_CodeSniffer autofix diff" + if: success() || failure() + run: | + vendor/bin/phpcbf -q --no-colors --report=checkstyle || true + git add . -N && git diff From 0f68f8672637b7ddf625419e1f03e48bc4a443ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 17 May 2024 13:28:07 +0200 Subject: [PATCH 2/4] run on failure only --- .github/workflows/coding-standards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index f777c41..a282131 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -56,7 +56,7 @@ jobs: run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr" - name: "Output PHP_CodeSniffer autofix diff" - if: success() || failure() + if: failure() run: | vendor/bin/phpcbf -q --no-colors --report=checkstyle || true git add . -N && git diff From c3c56747b47a7f37a9f76e3581437c51f3eca036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 17 May 2024 21:19:39 +0200 Subject: [PATCH 3/4] show diff in the same job step --- .github/workflows/coding-standards.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index a282131..068c49f 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -53,10 +53,6 @@ jobs: # https://github.com/doctrine/.github/issues/3 - name: "Run PHP_CodeSniffer" - run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr" - - - name: "Output PHP_CodeSniffer autofix diff" - if: failure() run: | - vendor/bin/phpcbf -q --no-colors --report=checkstyle || true - git add . -N && git diff + vendor/bin/phpcs -q --no-colors --report=diff || true + vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr From 476ce58071da9cf9920170edd87c3c2ae555553f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 18 May 2024 00:41:25 +0200 Subject: [PATCH 4/4] output diff with colors --- .github/workflows/coding-standards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 068c49f..a186ba3 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -54,5 +54,5 @@ jobs: # https://github.com/doctrine/.github/issues/3 - name: "Run PHP_CodeSniffer" run: | - vendor/bin/phpcs -q --no-colors --report=diff || true + vendor/bin/phpcs -q --report=diff || true vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr