Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to skip lines #136

Merged
merged 4 commits into from Dec 20, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions pep8.py
Expand Up @@ -264,6 +264,8 @@ def maximum_line_length(physical_line, max_line_length):
line = physical_line.rstrip() line = physical_line.rstrip()
length = len(line) length = len(line)
if length > max_line_length: if length > max_line_length:
if line.strip().lower().endswith('# nopep8'):
return
if hasattr(line, 'decode'): # Python 2 if hasattr(line, 'decode'): # Python 2
# The line could contain multi-byte characters # The line could contain multi-byte characters
try: try:
Expand Down Expand Up @@ -477,6 +479,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
Expand Down