X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=devops-stages%2Fstage-test.sh;h=31161ac22809973ac1cb432e5788071ebe585959;hb=c0bf951271b606fc92648cc672c058522cdd8ed1;hp=00c8981e7894817bced81374aa1e19c5ab7e51da;hpb=f4ebaa88025189ede4f073ab8a1f27c95efff867;p=osm%2Ftests.git diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index 00c8981..31161ac 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -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' " && \ + 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,18 @@ 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!" + +# Other policies to be added here: +# - Blank lines used to separate main sections (Settings, Variables, Test Cases, Keywords) +# - Blank lines used to separate parts of eah section: +# - Variables: max 1 blank line to separate each one +# - Settings: 1 blank line to separate each kind of setting (all LIbrary together, all Resource together, etc.) +# - Test cases: 2 blank lines between test cases, max 1 blank line inside Test case, no blank line after Test Case Keyword + echo "SUCCESS" exit 0