diff --git a/README b/README index 3156b3b..c4c2877 100644 --- a/README +++ b/README @@ -18,7 +18,10 @@ It also adds a few features: # flake8: noqa -- lines that contains a "# NOQA" comment at the end will not issue a warning. +- lines that contain a "# NOQA" comment at the end will not issue pyflakes + warnings. +- lines that contain a "# NOPEP8" comment at the end will not issue pep8 + warnings. - a Mercurial hook. - a McCabe complexity checker. diff --git a/flake8/pep8.py b/flake8/pep8.py index d513b5a..b0240a1 100644 --- a/flake8/pep8.py +++ b/flake8/pep8.py @@ -267,6 +267,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: