Enforce Style Guidelines 73/16873/2
authorMark Beierl <mark.beierl@emc.com>
Thu, 14 Jul 2016 03:26:00 +0000 (23:26 -0400)
committerMark Beierl <mark.beierl@emc.com>
Thu, 14 Jul 2016 20:09:55 +0000 (20:09 +0000)
Update to fail verify if pep8 compliance not met.
Revert back to Coverage 4.1 to show code coverage
report in Jenkins again

Change-Id: Icb467451f101942255c7944ad796497609dcb07e
Signed-off-by: Mark Beierl <mark.beierl@emc.com>
ci/setup.py
ci/verify.sh
storperf/plot/barchart.py

index a293e9c..2a02276 100755 (executable)
@@ -25,7 +25,6 @@ setup(
                       "flask-restful==0.3.5",
                       "flask-restful-swagger==0.19",
                       "html2text==2016.1.8",
-                      "matplotlib==1.3.1",
                       "python-cinderclient==1.6.0",
                       "python-glanceclient==1.1.0",
                       "python-heatclient==0.8.0",
index d309319..89b1406 100755 (executable)
@@ -21,7 +21,7 @@ source $WORKSPACE/storperf_venv/bin/activate
 pip install setuptools
 pip install autoflake==0.6.6
 pip install autopep8==1.2.2
-pip install coverage==3.4
+pip install coverage==4.1
 pip install flask==0.10
 pip install flask-restful==0.3.5
 pip install flask-restful-swagger==0.19
@@ -29,6 +29,7 @@ pip install flask-swagger==0.2.12
 pip install funcsigs==0.4
 pip install flake8==2.5.4
 pip install html2text==2016.1.8
+pip install matplotlib==1.3.1
 pip install mock==1.3.0
 pip install nose==1.3.7
 pip install python-cinderclient==1.6.0
@@ -45,6 +46,8 @@ python ci/setup.py develop
 
 flake8 storperf
 
+flake8rc=$?
+
 nosetests --with-xunit \
          --with-coverage \
          --cover-package=storperf\
@@ -54,4 +57,10 @@ rc=$?
 
 deactivate
 
-exit $rc
+if [ $flake8rc -ne 0 ]
+then
+    echo "Formatting did not meet guidelines"
+    exit $flake8rc
+fi
+
+exit $rc
\ No newline at end of file
index 6fcfd8d..f82f3b8 100644 (file)
@@ -11,9 +11,9 @@ import cStringIO
 
 import matplotlib as mpl
 mpl.use('Agg')
-import matplotlib.pyplot as pyplot
-from mpl_toolkits.mplot3d import Axes3D
-import numpy as np
+import matplotlib.pyplot as pyplot  # noqa: ignore E402
+from mpl_toolkits.mplot3d import Axes3D  # noqa: ignore E402, F401
+import numpy as np  # noqa: ignore E402
 
 
 class Barchart(object):
@@ -25,8 +25,6 @@ class Barchart(object):
 
         fig = pyplot.figure()
 
-        #ax = Axes3D(fig)
-
         data = np.array(latencies)
 
         lx = len(data[0])          # Work out matrix dimensions