summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtools/hacking.py12
-rw-r--r--tools/test-requires2
-rw-r--r--tox.ini4
3 files changed, 10 insertions, 8 deletions
diff --git a/tools/hacking.py b/tools/hacking.py
index 096cf7786..1c2e11218 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -137,7 +137,7 @@ def nova_except_format(logical_line):
N201
"""
if logical_line.startswith("except:"):
- return 6, "NOVA N201: no 'except:' at least use 'except Exception:'"
+ yield 6, "NOVA N201: no 'except:' at least use 'except Exception:'"
def nova_except_format_assert(logical_line):
@@ -148,7 +148,7 @@ def nova_except_format_assert(logical_line):
N202
"""
if logical_line.startswith("self.assertRaises(Exception"):
- return 1, "NOVA N202: assertRaises Exception too broad"
+ yield 1, "NOVA N202: assertRaises Exception too broad"
def nova_one_import_per_line(logical_line):
@@ -166,7 +166,7 @@ def nova_one_import_per_line(logical_line):
if (pos > -1 and (parts[0] == "import" or
parts[0] == "from" and parts[2] == "import") and
not is_import_exception(parts[1])):
- return pos, "NOVA N301: one import per line"
+ yield pos, "NOVA N301: one import per line"
_missingImport = set([])
@@ -241,7 +241,9 @@ def nova_import_module_only(logical_line):
(len(split_line) == 2 or
(len(split_line) == 4 and split_line[2] == "as"))):
mod = split_line[1]
- return importModuleCheck(mod)
+ rval = importModuleCheck(mod)
+ if rval != None:
+ yield rval
# TODO(jogo) handle "from x import *"
@@ -398,7 +400,7 @@ def nova_localization_strings(logical_line, tokens):
map(gen.send, tokens)
gen.close()
except LocalizationError as e:
- return e.args
+ yield e.args
#TODO(jogo) Dict and list objects
diff --git a/tools/test-requires b/tools/test-requires
index 74910be0d..1931f313a 100644
--- a/tools/test-requires
+++ b/tools/test-requires
@@ -7,7 +7,7 @@ mox==0.5.3
nose
openstack.nose_plugin>=0.7
nosehtmloutput
-pep8==1.1
+pep8==1.2
pylint==0.25.2
sphinx>=1.1.2
feedparser
diff --git a/tox.ini b/tox.ini
index dc46b5fb4..e7458e6a1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -22,9 +22,9 @@ sitepackages = True
downloadcache = ~/cache/pip
[testenv:pep8]
-deps=pep8==1.0.1
+deps=pep8==1.2
commands =
- python tools/hacking.py --ignore=N4 --repeat --show-source \
+ python tools/hacking.py --ignore=N4,E12,E711,E712,E721,E502 --repeat --show-source \
--exclude=.venv,.tox,dist,doc,*openstack/common*,*lib/python*,*egg .
[testenv:pylint]