Address flake8 3.x violations

Before we bump the minimum version, fix the violations it will
introduce. Nothing odd here.

Change-Id: I0392cd596b7476a3e6c8e832e8559c13e32ebf0b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2019-12-11 17:17:47 +00:00
parent 51eadb6698
commit b6bca99c62
3 changed files with 7 additions and 7 deletions

View File

@ -59,7 +59,7 @@ def hacking_has_license(physical_line, filename, lines, line_number):
# skip files that are < 10 lines, which isn't enough for a license to fit
# this allows us to handle empty files, as well as not fail on the Okay
# doctests.
if line_number is 1 and len(lines) > 10 and _project_is_apache():
if line_number == 1 and len(lines) > 10 and _project_is_apache():
for idx, line in enumerate(lines):
# if it's more than 10 characters in, it's probably not in the
# header
@ -83,7 +83,7 @@ def hacking_has_correct_license(physical_line, filename, lines, line_number):
# skip files that are < 10 lines, which isn't enough for a license to fit
# this allows us to handle empty files, as well as not fail on the Okay
# doctests.
if line_number is 1 and len(lines) > 10 and _project_is_apache():
if line_number == 1 and len(lines) > 10 and _project_is_apache():
for idx, line in enumerate(lines):
column = line.find('Licensed under the Apache License')
if (0 < column < 10 and not

View File

@ -118,7 +118,7 @@ def hacking_docstring_summary(physical_line, previous_logical, tokens):
# not a multi line docstring
return
lines = docstring.split('\n')
if len(lines) > 1 and len(lines[1].strip()) is not 0:
if len(lines) > 1 and len(lines[1].strip()) != 0:
# docstrings get tokenized on the last line of the docstring, so
# we don't know the exact position.
return (0, "H405: multi line docstring "