summaryrefslogtreecommitdiffstats
path: root/conductor/tox.ini
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2020-08-16 19:07:09 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2020-08-17 11:30:35 +0530
commit8e23179dd67da6517382369d579e62f2435d02c8 (patch)
treefa1a3af2c9156cc7553734c30759b6836ce663d3 /conductor/tox.ini
parent8a17d08ff5b10ffc37cafb56d90185c39250afc8 (diff)
Add new tox env to check for pep8 issues
The linter will check for issues in new and updated files for a new commit Issue-ID: OPTFRA-837 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: Id0759380475f5360c340abb71cd0afe0761beac8
Diffstat (limited to 'conductor/tox.ini')
-rw-r--r--conductor/tox.ini14
1 files changed, 11 insertions, 3 deletions
diff --git a/conductor/tox.ini b/conductor/tox.ini
index e358564..3fe867a 100644
--- a/conductor/tox.ini
+++ b/conductor/tox.ini
@@ -2,7 +2,7 @@
minversion = 1.6
skipsdist = True
#envlist = py35,py27,functional,pep8
-envlist = py3,pep8
+envlist = py3,pep8,pep8diff
[testenv]
basepython=python3
deps = -r{toxinidir}/requirements.txt
@@ -44,6 +44,11 @@ deps = hacking>=2.0.0
commands =
flake8 --exit-zero
+[testenv:pep8diff]
+deps = hacking>=2.0.0
+commands =
+ bash -c "files=$(git diff HEAD^ HEAD --relative --diff-filter=d --name-only | grep -E '(^conductor\/)'| grep -E '*\.py$'); if [[ -z $files ]]; then exit 0; else flake8 $files; fi"
+
[testenv:genconfig]
commands = oslo-config-generator --config-file=etc/conductor/conductor-config-generator.conf
@@ -55,9 +60,12 @@ setenv = PYTHONHASHSEED=0
commands = bash -x oslo_debug_helper {posargs}
[flake8]
-ignore = H301,E401,E226,E302,E41,E303,E501,E265,E125,E101,E131,E127,E306,
-exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,install-guide
+select = E,H,W,F
+max-line-length = 119
+exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,install-guide,*/tests/*
show-source = True
+ignore=
+per-file-ignores=
[hacking]
import_exceptions = conductor.common.i18n