From 6fcd0ec1ee5528b42b5c8475e5e8ac6a85ce6977 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 12 Jul 2018 23:25:43 +0200 Subject: [PATCH] Test for hard coded language --- Hooks/syntax.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Hooks/syntax.sh b/Hooks/syntax.sh index 4e298ba..20e3824 100644 --- a/Hooks/syntax.sh +++ b/Hooks/syntax.sh @@ -55,6 +55,12 @@ if [[ "$FILE" =~ ^.+(tpl\.php|html)$ ]]; then echo -e "\e[1;31m\tValue field should not be hard coded.\e[0m" >&2 grep -P '(value=\")((?!\<\?).)*(>)' $FILE >&2 fi + + # Hard coded language *warning* + if [[ -n $(grep -P '(\|\|\|\)[0-9a-zA-Z\.\?]+' $FILE) ]]; then + echo -e "\e[1;31m\tFound hard coded text.\e[0m" >&2 + grep -P '(\|\|\|\)[0-9a-zA-Z\.\?]+' $FILE >&2 + fi fi if [[ "$FILE" =~ ^.+(sh)$ ]]; then