+
+check_tabs () {
+ folder="$1"
+ tabs="y"
+ ! grep -r " " ${folder} && tabs=""
+ [ -n "${tabs}" ] && \
+ echo "There are tabs in ${folder}" && \
+ echo "Please replace by spaces" && \
+ exit 1
+}
+
+check_two_spaces () {
+ folder="$1"
+ two_spaces="y"
+ ! grep -r "[^ ] [^ ]" ${folder} && two_spaces=""
+ [ -n "${two_spaces}" ] && \
+ echo "Some files in ${folder} are using two spaces to separate params" && \
+ echo "Use this command to change it:" && \
+ echo " sed -i 's/\([^ ]\) \([^ ]\)/\\\1 \\\2/g' <FILENAME>" && \
+ exit 1
+}
+
+check_four_spaces () {
+ folder="$1"
+ four_spaces="y"
+ ! grep -r "[^# \.] " ${folder} && four_spaces=""
+ [ -n "${four_spaces}" ] && \
+ echo "Some files in ${folder} are using four spaces or more to separate params" && \
+ echo "You can try this command to change it:" && \
+ echo " sed -i 's/\([^# \.]\) */\\\1 /g' <FILENAME>" && \
+ exit 1
+}
+
+check_crlf_terminators () {
+ folder="$1"
+ crlf_terminators="y"
+ ! (find ${folder} -not -type d -exec file "{}" ";" | grep CRLF) && crlf_terminators=""
+ [ -n "${crlf_terminators}" ] && \
+ echo "Some files in ${folder} have CRLF at the end of some lines" && \
+ echo "Use this command to change it:" && \
+ echo " dos2unix <FILENAME>" && \
+ exit 1
+}
+