diff --git a/pep8.py b/pep8.py index d57cdf39..00b51bd0 100755 --- a/pep8.py +++ b/pep8.py @@ -264,6 +264,8 @@ def maximum_line_length(physical_line, max_line_length): line = physical_line.rstrip() length = len(line) if length > max_line_length: + if line.strip().lower().endswith('# nopep8'): + return if hasattr(line, 'decode'): # Python 2 # The line could contain multi-byte characters try: @@ -477,6 +479,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