ttrss/utils/phpstan-watcher.sh

21 lines
525 B
Bash
Raw Normal View History

2022-07-31 08:13:17 +00:00
#!/bin/sh
PHP_VERSION="$1"
[ -z "$PHP_VERSION" ] && PHP_VERSION=8.1
echo PHP_VERSION: ${PHP_VERSION}
echo PWD: $(pwd)
while true; do
inotifywait . -e close_write -r -t 300 | grep -q .php && \
(
MODIFIED=$(git ls-files -m | grep .php)
2022-07-31 08:13:17 +00:00
docker run --rm -v $(pwd):/app -v /tmp/phpstan-8.1:/tmp/phpstan \
--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}
2022-07-31 08:13:17 +00:00
echo All done, RC=$?.
)
sleep 1
done