summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-10-10 19:53:50 +0000
committerGerrit Code Review <review@openstack.org>2012-10-10 19:53:50 +0000
commita54ced97f9c94515686becd3e0641bbdcf782540 (patch)
treece805e786e5bf58f0051d1e0f2ff5f9c16ad0387 /tools
parent8f06be98b8e83c5e74d12bfb7607e76902cd9385 (diff)
parentfbc4568eb09bc2fe2d3d758758eb5e6a55c821ff (diff)
downloadnova-a54ced97f9c94515686becd3e0641bbdcf782540.tar.gz
nova-a54ced97f9c94515686becd3e0641bbdcf782540.tar.xz
nova-a54ced97f9c94515686becd3e0641bbdcf782540.zip
Merge "Update tools hacking for pep8 1.2 and beyond"
Diffstat (limited to 'tools')
-rwxr-xr-xtools/hacking.py12
-rw-r--r--tools/test-requires2
2 files changed, 8 insertions, 6 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 2245b46a8..f5a391a78 100644
--- a/tools/test-requires
+++ b/tools/test-requires
@@ -6,7 +6,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