From 4a2b83ab47c126009b10221c1fb1f336f6cf807f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 6 Feb 2017 18:39:26 +0000 Subject: [PATCH] Use xargs multi-process to improve lint scanning speed in tests --- tests/lint.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/lint.sh b/tests/lint.sh index 61378cd45..0668c2ac9 100755 --- a/tests/lint.sh +++ b/tests/lint.sh @@ -11,9 +11,12 @@ while getopts "p:" OPTION 2> /dev/null; do done echo Running PHP lint scans... -shopt -s globstar -for file in src/pocketmine/**/*.php; do - OUTPUT=`"$PHP_BINARY" -l "$file"` - [ $? -ne 0 ] && echo -n "$OUTPUT" && exit 1 -done + +OUTPUT=`find ./src/pocketmine -name "*.php" -print0 | xargs -0 -n1 -P4 php -l` + +if [ $? -ne 0 ]; then + echo $OUTPUT | grep -v "No syntax errors" + exit 1 +fi + echo Lint scan completed successfully. \ No newline at end of file