blob: 88e0a8bd5fe6917517a21f2da76df08f5f9f6a9e [file] [log] [blame]
Devin Lim18f459d2018-01-26 19:20:30 -08001#!/bin/bash
2
Devin Lim157404d2018-02-09 16:44:19 -08003cd $WORKSPACE
4rm -rf OnosSystemTest
5rm -f pep8Result.txt
Jon Hall03d713f2020-07-31 13:49:42 -07006git clone https://gerrit.onosproject.org/OnosSystemTest && cd OnosSystemTest
7git fetch "https://gerrit.onosproject.org/OnosSystemTest" $GERRIT_REFSPEC && git checkout FETCH_HEAD
Devin Lim157404d2018-02-09 16:44:19 -08008
Devin Lim18f459d2018-01-26 19:20:30 -08009cd
10cd $WORKSPACE/OnosSystemTest/
Jon Hall02f1aea2018-05-11 13:53:59 -070011modifiedFiles=$(git diff-tree --no-commit-id --name-only -r HEAD | grep \.py$) || modifiedFiles=""
Devin Lim18f459d2018-01-26 19:20:30 -080012if [ -n "$modifiedFiles" ]
13then
14 pep8 --repeat --show-source --show-pep8 --ignore=E251,E201,E302,E202,E126,E127,E203,E226,E501,W391 $modifiedFiles > $WORKSPACE/pep8Result.txt
15else
16 touch $WORKSPACE/pep8Result.txt
17 rm -rf $WORKSPACE/OnosSystemTest/
Jeremy Ronquillo85a58042019-08-21 10:53:43 -070018 echo "There were no files to code check. Please complete style check manually."
19 exit 0
Devin Lim59f6d1a2018-02-09 17:18:56 -080020fi
21
22cat $WORKSPACE/pep8Result.txt
Jon Hall02f1aea2018-05-11 13:53:59 -070023rm -rf $WORKSPACE/OnosSystemTest/