blob: 25599785bb6292dfd71d9f3cec3d221c06db6cbb [file] [log] [blame]
#!/bin/bash
cd $WORKSPACE
rm -rf OnosSystemTest
rm -f pep8Result.txt
git clone https://gerrit.onosproject.org/OnosSystemTest; cd OnosSystemTest
git review -d ${GERRIT_CHANGE_NUMBER}
cd
cd $WORKSPACE/OnosSystemTest/
modifiedFiles=$(git diff-tree --no-commit-id --name-only -r HEAD | grep \.py$) || modifiedFiles=""
if [ -n "$modifiedFiles" ]
then
pep8 --repeat --show-source --show-pep8 --ignore=E251,E201,E302,E202,E126,E127,E203,E226,E501,W391 $modifiedFiles > $WORKSPACE/pep8Result.txt
else
touch $WORKSPACE/pep8Result.txt
rm -rf $WORKSPACE/OnosSystemTest/
echo "There were no files to code check. Please complete style check manually."
exit 0
fi
cat $WORKSPACE/pep8Result.txt
rm -rf $WORKSPACE/OnosSystemTest/