mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-02-13 09:38:41 +00:00
Added find whitepsace check
This commit is contained in:
parent
51cb526d8f
commit
f03d879a9f
|
|
@ -10,14 +10,14 @@ if [[ "$FILE" =~ ^.+(php)$ ]]; then
|
||||||
echo -e "\e[1;31m\tPhp linting error.\e[0m" >&2
|
echo -e "\e[1;31m\tPhp linting error.\e[0m" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# phpcs
|
# phpcs
|
||||||
${rootpath}/vendor/bin/phpcs --standard="${rootpath}/Build/Config/phpcs.xml" --encoding=utf-8 -n -p $FILE
|
${rootpath}/vendor/bin/phpcs --standard="${rootpath}/Build/Config/phpcs.xml" --encoding=utf-8 -n -p $FILE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -e "\e[1;31m\tCode Sniffer error.\e[0m" >&2
|
echo -e "\e[1;31m\tCode Sniffer error.\e[0m" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# phpmd
|
# phpmd
|
||||||
${rootpath}/vendor/bin/phpmd $FILE text ${rootpath}/Build/Config/phpmd.xml --exclude *tests* --minimumpriority 1
|
${rootpath}/vendor/bin/phpmd $FILE text ${rootpath}/Build/Config/phpmd.xml --exclude *tests* --minimumpriority 1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
@ -38,4 +38,10 @@ if [[ "$FILE" =~ ^.+(sh)$ ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check whitespace end of line
|
||||||
|
if [[ -n $(find $FILE -type f -exec egrep -l " +$" {} \;) ]]; then
|
||||||
|
echo -e "\e[1;31m\tFound whitespace at end of line.\e[0m" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
done || exit $?
|
done || exit $?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user