From 152545b3c9081244937651a0fe782e9891b6e2d0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 6 Apr 2023 20:25:48 +0300 Subject: [PATCH] phpstan task: analyze only modified files --- utils/phpstan-watcher.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/phpstan-watcher.sh b/utils/phpstan-watcher.sh index d1acc906f..4c8f1bfa1 100644 --- a/utils/phpstan-watcher.sh +++ b/utils/phpstan-watcher.sh @@ -10,8 +10,10 @@ echo PWD: $(pwd) while true; do inotifywait . -e close_write -r -t 300 | grep -q .php && \ ( + MODIFIED=$(git ls-files -m | grep .php) + docker run --rm -v $(pwd):/app -v /tmp/phpstan-8.1:/tmp/phpstan \ - --workdir /app php:${PHP_VERSION}-cli php -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G --error-format=raw + --workdir /app registry.fakecake.org/cthulhoo/ci-alpine:3.16 php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G --error-format=raw analyze ${MODIFIED} echo All done, RC=$?. ) sleep 1