summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-04-06 20:25:48 +0300
committerAndrew Dolgov <[email protected]>2023-04-06 20:25:48 +0300
commit152545b3c9081244937651a0fe782e9891b6e2d0 (patch)
treec24f1f6c6274e70c48e9d9a949234922e5e59130 /utils
parent881f8805bd359cb92112c6c82615b580a5a5eb80 (diff)
phpstan task: analyze only modified files
Diffstat (limited to 'utils')
-rw-r--r--utils/phpstan-watcher.sh4
1 files changed, 3 insertions, 1 deletions
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