mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-09 06:14:17 +00:00
Closes #37 again
Although I cannot reproduce the error in clean virtualenv's I added an extra check to be 100% certain. Also, # nopep8 is entirely documented in the README. I entirely forgot about it when it was first introduced (except for adding it to the "Changes"" section).
This commit is contained in:
parent
16f338efd6
commit
7dbf2f727b
2 changed files with 6 additions and 1 deletions
5
README
5
README
|
|
@ -18,7 +18,10 @@ It also adds a few features:
|
||||||
|
|
||||||
# flake8: noqa
|
# 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 Mercurial hook.
|
||||||
- a McCabe complexity checker.
|
- a McCabe complexity checker.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -267,6 +267,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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue