Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Devin Lim | 157404d | 2018-02-09 16:44:19 -0800 | [diff] [blame] | 3 | cd $WORKSPACE |
| 4 | rm -rf OnosSystemTest |
| 5 | rm -f pep8Result.txt |
Jon Hall | 03d713f | 2020-07-31 13:49:42 -0700 | [diff] [blame] | 6 | git clone https://gerrit.onosproject.org/OnosSystemTest && cd OnosSystemTest |
| 7 | git fetch "https://gerrit.onosproject.org/OnosSystemTest" $GERRIT_REFSPEC && git checkout FETCH_HEAD |
Devin Lim | 157404d | 2018-02-09 16:44:19 -0800 | [diff] [blame] | 8 | |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 9 | cd |
| 10 | cd $WORKSPACE/OnosSystemTest/ |
Jon Hall | 02f1aea | 2018-05-11 13:53:59 -0700 | [diff] [blame] | 11 | modifiedFiles=$(git diff-tree --no-commit-id --name-only -r HEAD | grep \.py$) || modifiedFiles="" |
Devin Lim | 18f459d | 2018-01-26 19:20:30 -0800 | [diff] [blame] | 12 | if [ -n "$modifiedFiles" ] |
| 13 | then |
| 14 | pep8 --repeat --show-source --show-pep8 --ignore=E251,E201,E302,E202,E126,E127,E203,E226,E501,W391 $modifiedFiles > $WORKSPACE/pep8Result.txt |
| 15 | else |
| 16 | touch $WORKSPACE/pep8Result.txt |
| 17 | rm -rf $WORKSPACE/OnosSystemTest/ |
Jeremy Ronquillo | 85a5804 | 2019-08-21 10:53:43 -0700 | [diff] [blame] | 18 | echo "There were no files to code check. Please complete style check manually." |
| 19 | exit 0 |
Devin Lim | 59f6d1a | 2018-02-09 17:18:56 -0800 | [diff] [blame] | 20 | fi |
| 21 | |
| 22 | cat $WORKSPACE/pep8Result.txt |
Jon Hall | 02f1aea | 2018-05-11 13:53:59 -0700 | [diff] [blame] | 23 | rm -rf $WORKSPACE/OnosSystemTest/ |