Add new tox env to check for pep8 issues
[optf/osdf.git] / tox.ini
diff --git a/tox.ini b/tox.ini
index c91b77f..1606b9b 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,7 @@
 
 [tox]
 skipsdist=True
-envlist = py3, pylint
+envlist = py3, pylint, flake8diff
 
 [testenv]
 distribute = False
@@ -17,13 +17,27 @@ commands =
     # TODO: need to update the above "omit" when we package osdf as pip-installable
 deps = -r{toxinidir}/requirements.txt
     -r{toxinidir}/test/test-requirements.txt
+    -r{toxinidir}/requirements-osdf.txt
+    -r{toxinidir}/requirements-opteng.txt
 
 [run]
-source=./osdf/,osdfapp.py
+source=./apps/,./osdf/,osdfapp.py,./runtime/,solverapp.py
 
 [testenv:pylint]
 whitelist_externals=bash
-commands = bash -c "pylint --reports=y osdf | tee pylint.out"
+commands = bash -c "pylint --reports=y osdf apps runtime| tee pylint.out"
 
 [testenv:py3]
 basepython=python3.6
+
+[testenv:flake8diff]
+whitelist_externals=bash
+deps = hacking>=2.0.0
+commands =
+  bash -c "files=$(git diff HEAD^ HEAD --diff-filter=d --name-only | grep -E '(^apps\/|osdf\/|runtime\/)'| grep -E '*\.py$'); if [[ -z $files ]]; then exit 0; else flake8 $files; fi"
+
+[flake8]
+select = E,H,W,F
+max-line-length = 119
+ignore =
+per-file-ignores=