From 733743acca3d5d22050b20c0a8058675b976ed86 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Mon, 15 Jan 2024 14:13:44 +0100 Subject: [PATCH 1/2] Use updated PHP-CS-Fixer in standard location --- php-cs/check-php-cs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-cs/check-php-cs.sh b/php-cs/check-php-cs.sh index b3d2869..986885e 100755 --- a/php-cs/check-php-cs.sh +++ b/php-cs/check-php-cs.sh @@ -8,4 +8,4 @@ else EXTRA_ARGS=''; fi -./bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --diff --diff-format=udiff --dry-run --using-cache=no ${EXTRA_ARGS} +./vendor/bin/php-cs-fixer check -v --diff --using-cache=no ${EXTRA_ARGS} From aa8725eb58aab2e18a0a3265536ce1b1ec58c386 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Mon, 15 Jan 2024 15:07:45 +0100 Subject: [PATCH 2/2] Update script according to recommendations from https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#using-php-cs-fixer-on-ci --- php-cs/check-php-cs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php-cs/check-php-cs.sh b/php-cs/check-php-cs.sh index 986885e..45aed32 100755 --- a/php-cs/check-php-cs.sh +++ b/php-cs/check-php-cs.sh @@ -2,10 +2,10 @@ # # Checks the PHP CS syntax # -if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then +if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi -./vendor/bin/php-cs-fixer check -v --diff --using-cache=no ${EXTRA_ARGS} +./vendor/bin/php-cs-fixer fix -v --diff --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}