phpstan task: analyze only modified files

This commit is contained in:
Andrew Dolgov 2023-04-06 20:25:48 +03:00
parent 881f8805bd
commit 152545b3c9
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
1 changed files with 3 additions and 1 deletions

View File

@ -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