summaryrefslogtreecommitdiff
path: root/utils/phpstan-watcher.sh
blob: 70eb1d9ab139f2bf1dc7aff906620ba0d9e3300d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

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 registry.fakecake.org/ci/php8.2-alpine:3.18 php82 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G --error-format=raw analyze ${MODIFIED}
			echo All done, RC=$?.
		)
	sleep 1
done