From 7f1da5b1a9b3cc63dbc158d1e18b26f09e5c9865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Wed, 14 Dec 2016 12:45:11 +0100 Subject: [PATCH] added lint.sh which needs to be executed like this: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $ ./util/lint.sh No parameters needed. It will use "php -l" (current interpreter) for checking for syntax errors in all PHP scripts. Signed-off-by: Roland Häder --- util/lint.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 util/lint.sh diff --git a/util/lint.sh b/util/lint.sh new file mode 100755 index 0000000000..ef1530f859 --- /dev/null +++ b/util/lint.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +if ! test -e "index.php"; then + echo "$0: Please execute this script from root directory." + exit 1 +fi + +echo "$0: Analysing PHP scripts for syntax errors (lint) ..." +LINT=`find -type f -name "*.php" -exec php -l -f {} 2>&1 \; | grep -v "No syntax errors detected in" | grep -v "FUSE_EDEADLK" | sort --unique` + +if test "${LINT}" != ""; then + echo "${LINT}" +else + echo "$0: No syntax errors found." +fi