From 309b308adc192423aa9f39f66f05c1d119f323bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Dec 2023 20:45:02 +0100 Subject: [PATCH] Debug php-cs-fixer --- .gitignore | 1 + .php-cs-fixer.dist.php | 2 ++ dev/tools/.gitignore | 1 + dev/tools/run-php-cs-fixer.sh | 8 +++++++- 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 dev/tools/.gitignore mode change 100644 => 100755 dev/tools/run-php-cs-fixer.sh diff --git a/.gitignore b/.gitignore index 4f432c0b674..dabdebc9ca9 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ doc/install.lock /build/phpstan/phpstan /build/phpstan/bootstrap_custom.php phpstan_custom.neon +/.php-cs-fixer.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index d145f9e143d..b8709b88a33 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -3,6 +3,8 @@ $finder = (new PhpCsFixer\Finder()) ->in(__DIR__) ->exclude([ + 'documents', + 'htdocs/custom', 'htdocs/includes', ]) ->notPath([ diff --git a/dev/tools/.gitignore b/dev/tools/.gitignore new file mode 100644 index 00000000000..57872d0f1e5 --- /dev/null +++ b/dev/tools/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/dev/tools/run-php-cs-fixer.sh b/dev/tools/run-php-cs-fixer.sh old mode 100644 new mode 100755 index 309e1dfec59..8bd52e34da9 --- a/dev/tools/run-php-cs-fixer.sh +++ b/dev/tools/run-php-cs-fixer.sh @@ -6,7 +6,7 @@ # Optionally set COMPOSER_VENDOR_DIR to your vendor path for composer. # # Run php-cs-fixer by calling this script: -# ./run-php-cs-fixer.sh check # Only checks (the default) +# ./run-php-cs-fixer.sh check # Only checks # ./run-php-cs-fixer.sh fix # Fixes # # You can fix only a few files using @@ -42,6 +42,12 @@ if [ ! -r "${PHP_CS_FIXER}" ] ; then fi +if [ "x$1" = "x" ]; then + echo "***** run-php-cs-fixer.sh *****" + echo "Syntax: run-php-cs-fixer.sh check|fix [path]" + exit 1; +fi + ( cd "${MYDIR}/../.." || exit CMD=