topaz2/chef_boilerplate_php

View on GitHub
files/default/git/hooks/php/lint

Summary

Maintainability
Test Coverage
#!/bin/bash -e

PROJECT=`php -r "echo dirname(dirname(dirname(dirname(realpath('$0')))));"`

echo "Checking PHP Lint..."
for FILE in `git diff --cached --name-only --diff-filter=ACMR HEAD | egrep \\\\.\(php\|ctp\)\$`
do
  php -l -d display_errors=0 $PROJECT/$FILE || exit $?
done

exit 0