summaryrefslogtreecommitdiff
path: root/tools/hacking.py
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2016-03-03 16:20:10 -0600
committerRyan Harper <ryan.harper@canonical.com>2016-03-03 16:20:10 -0600
commit8cb7c3f7b5339e686bfbf95996b51afafeaf9c9e (patch)
tree6892cca7fb6c81ed150d037a192b9a9d0e30068b /tools/hacking.py
parent9a3a490fadc5b61e0fa14cde2d4f79164115ae25 (diff)
downloadvyos-cloud-init-8cb7c3f7b5339e686bfbf95996b51afafeaf9c9e.tar.gz
vyos-cloud-init-8cb7c3f7b5339e686bfbf95996b51afafeaf9c9e.zip
Update pep8 runner and fix pep8 issues
Diffstat (limited to 'tools/hacking.py')
-rwxr-xr-xtools/hacking.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/hacking.py b/tools/hacking.py
index 3175df38..1a0631c2 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -47,10 +47,10 @@ def import_normalize(line):
# handle "from x import y as z" to "import x.y as z"
split_line = line.split()
if (line.startswith("from ") and "," not in line and
- split_line[2] == "import" and split_line[3] != "*" and
- split_line[1] != "__future__" and
- (len(split_line) == 4 or
- (len(split_line) == 6 and split_line[4] == "as"))):
+ split_line[2] == "import" and split_line[3] != "*" and
+ split_line[1] != "__future__" and
+ (len(split_line) == 4 or
+ (len(split_line) == 6 and split_line[4] == "as"))):
return "import %s.%s" % (split_line[1], split_line[3])
else:
return line
@@ -74,7 +74,7 @@ def cloud_import_alphabetical(physical_line, line_number, lines):
split_line[0] == "import" and split_previous[0] == "import"):
if split_line[1] < split_previous[1]:
return (0, "N306: imports not in alphabetical order (%s, %s)"
- % (split_previous[1], split_line[1]))
+ % (split_previous[1], split_line[1]))
def cloud_docstring_start_space(physical_line):
@@ -87,8 +87,8 @@ def cloud_docstring_start_space(physical_line):
pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE]) # start
if (pos != -1 and len(physical_line) > pos + 1):
if (physical_line[pos + 3] == ' '):
- return (pos, "N401: one line docstring should not start with"
- " a space")
+ return (pos,
+ "N401: one line docstring should not start with a space")
def cloud_todo_format(physical_line):
@@ -167,4 +167,4 @@ if __name__ == "__main__":
finally:
if len(_missingImport) > 0:
print >> sys.stderr, ("%i imports missing in this test environment"
- % len(_missingImport))
+ % len(_missingImport))