#!/bin/sh
# lint: php -l em todos os arquivos proprios do app (nao aborta no primeiro erro)
APP="$1"
cd "$APP" || exit 1
find . -name '*.php' \
  -not -path './vendor/*' \
  -not -path './runtime/*' \
  -not -path './web/assets/*' \
  -not -path './nbproject/*' \
  -not -path './.git/*' \
  -print0 | xargs -0 -n1 -P4 sh -c 'php -l "$0" 2>&1 | grep -v "^No syntax errors" | sed "s|^|$0: |"' 2>&1 | head -60
echo "LINT_FIM"
