mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-03 22:36:27 +00:00
Prohibit tab characters in php files
This commit is contained in:
+8
-1
@@ -4,7 +4,14 @@ find . -type "f" -iname "*.php" | xargs -L "1" php -l
|
||||
# Run tests.
|
||||
cd tests && phpunit --configuration phpunit.xml
|
||||
|
||||
# Check for trailing whitespace in php files.
|
||||
# Prohibit tab characters in php files.
|
||||
tab_char=$(find . -type "f" -iname "*.php" -exec grep --line-number -H --perl-regexp "\t" {} \;)
|
||||
if [[ ! -z "${tab_char}" ]]; then
|
||||
echo -e "${tab_char}" | perl -pe 's/^(.*)$/Tab character found in \1/'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prohibit trailing whitespace in php files.
|
||||
trailing_whitespace=$(find . -type "f" -iname "*.php" -exec egrep --line-number -H " +$" {} \;)
|
||||
if [[ ! -z "${trailing_whitespace}" ]]; then
|
||||
echo -e "${trailing_whitespace}" | perl -pe 's/^(.*)$/Trailing whitespace found in \1/'
|
||||
|
||||
Reference in New Issue
Block a user