blob: 094e896209364c92e51917e941cb48856169a1b9 [file] [log] [blame]
Devin Lim18f459d2018-01-26 19:20:30 -08001#!/bin/bash
2
3cd $WORKSPACE
4rm -rf OnosSystemTest
5rm -f pep8Result.txt
6git clone https://gerrit.onosproject.org/OnosSystemTest; cd OnosSystemTest
7git review -d ${GERRIT_CHANGE_NUMBER}
8
9cd
10cd $WORKSPACE/OnosSystemTest/
11modifiedFiles=$(git diff-tree --no-commit-id --name-only -r HEAD | grep \.py) || modifiedFiles=""
12if [ -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/
18 echo "There were no files to code check, failing test so Jenkins doesn't comment."
19 exit 2
20fi
21cat $WORKSPACE/pep8Result.txt
22rm -rf $WORKSPACE/OnosSystemTest/