From 2484edfbc8517c124eef6752163e3eeb544961d2 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 14 Nov 2012 11:59:34 -0500 Subject: [PATCH] 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. --- flake8/pep8.py | 6 ++++-- flake8/run.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/flake8/pep8.py b/flake8/pep8.py index 01d512e..da9a112 100644 --- a/flake8/pep8.py +++ b/flake8/pep8.py @@ -482,6 +482,9 @@ def continuation_line_indentation(logical_line, tokens, indent_level, verbose): print(">>> " + tokens[0][4].rstrip()) for token_type, text, start, end, line in tokens: + if line.strip().lower().endswith('# nopep8'): + continue + newline = row < start[0] - first_row if newline: row = start[0] - first_row @@ -1205,8 +1208,7 @@ class Checker(object): self.line_number += 1 if self.line_number > len(self.lines): return '' - line = self.lines[self.line_number - 1] - return '' if line.lower().strip().endswith('# nopep8') else line + return self.lines[self.line_number - 1] def readline_check_physical(self): """ diff --git a/flake8/run.py b/flake8/run.py index f5cb831..f7b5b52 100644 --- a/flake8/run.py +++ b/flake8/run.py @@ -52,7 +52,7 @@ def _get_python_files(paths): yield fullpath else: - if not skip_file(path) or pep8style.excluded(fullpath): + if not skip_file(path) or pep8style.excluded(path): yield path