Add check of spaces at EOL in stage-test
[osm/tests.git] / devops-stages / stage-test.sh
index 00c8981..0fcf210 100755 (executable)
@@ -57,6 +57,17 @@ check_crlf_terminators () {
     exit 1
 }
 
+check_spaces_eol () {
+    folder="$1"
+    spaces_eol="y"
+    ! grep -ri " $" ${folder} && spaces_eol=""
+    [ -n "${spaces_eol}" ] && \
+    echo "Some files in ${folder} have spaces at the end of some lines" && \
+    echo "Use this command to change it:" && \
+    echo "   sed -i 's/ *$//g' <FILENAME>" && \
+    exit 1
+}
+
 echo "Checking tabs in robot files. No tabs should be present"
 check_tabs robot-systest/testsuite
 check_tabs robot-systest/lib
@@ -77,6 +88,11 @@ check_crlf_terminators robot-systest/testsuite
 check_crlf_terminators robot-systest/lib
 echo "No presence of CRLF terminators in robot files. Correct!"
 
+echo "Checking spaces at the end of lines in robot files. No spaces at EOL should be found"
+check_spaces_eol robot-systest/testsuite
+check_spaces_eol robot-systest/lib
+echo "No presence of spaces at EOL in robot files. Correct!"
+
 echo "SUCCESS"
 exit 0