mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 15:44:17 +00:00
Two problems I didn't see before that are now fixed.
First, I never got around to testing my changes to @kilian's patch for #23 and just found that I had mistyped a variable. Also, on more complex code that what I had tested on previously, my patch to pep8 was insufficient. This should work without error now.
This commit is contained in:
parent
70a75d8f08
commit
2484edfbc8
2 changed files with 5 additions and 3 deletions
|
|
@ -482,6 +482,9 @@ def continuation_line_indentation(logical_line, tokens, indent_level, verbose):
|
||||||
print(">>> " + tokens[0][4].rstrip())
|
print(">>> " + tokens[0][4].rstrip())
|
||||||
|
|
||||||
for token_type, text, start, end, line in tokens:
|
for token_type, text, start, end, line in tokens:
|
||||||
|
if line.strip().lower().endswith('# nopep8'):
|
||||||
|
continue
|
||||||
|
|
||||||
newline = row < start[0] - first_row
|
newline = row < start[0] - first_row
|
||||||
if newline:
|
if newline:
|
||||||
row = start[0] - first_row
|
row = start[0] - first_row
|
||||||
|
|
@ -1205,8 +1208,7 @@ class Checker(object):
|
||||||
self.line_number += 1
|
self.line_number += 1
|
||||||
if self.line_number > len(self.lines):
|
if self.line_number > len(self.lines):
|
||||||
return ''
|
return ''
|
||||||
line = self.lines[self.line_number - 1]
|
return self.lines[self.line_number - 1]
|
||||||
return '' if line.lower().strip().endswith('# nopep8') else line
|
|
||||||
|
|
||||||
def readline_check_physical(self):
|
def readline_check_physical(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ def _get_python_files(paths):
|
||||||
yield fullpath
|
yield fullpath
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not skip_file(path) or pep8style.excluded(fullpath):
|
if not skip_file(path) or pep8style.excluded(path):
|
||||||
yield path
|
yield path
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue