| #!/bin/bash |
| |
| cd $WORKSPACE |
| rm -rf OnosSystemTest |
| rm -f pep8Result.txt |
| git clone https://gerrit.onosproject.org/OnosSystemTest && cd OnosSystemTest |
| git fetch "https://gerrit.onosproject.org/OnosSystemTest" $GERRIT_REFSPEC && git checkout FETCH_HEAD |
| |
| 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/ |