summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2013-02-22 00:23:45 +0100
committerFlorent Xicluna <florent.xicluna@gmail.com>2013-02-22 00:23:45 +0100
commitde9157c829acf589d953261327252eeb6a740f0e (patch)
tree273d79b96b27fcb1ef675d0130ef47235a2dfb54
parentbc13b9285cf5a94603cd42205cb22997dbd371a8 (diff)
downloadpep8-de9157c829acf589d953261327252eeb6a740f0e.tar.gz
Use a permissive regex to detect the # noqa before the end of line
-rwxr-xr-xpep8.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/pep8.py b/pep8.py
index e6729e2..342ec24 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1050,6 +1050,7 @@ else:
def stdin_get_value():
return TextIOWrapper(sys.stdin.buffer, errors='ignore').read()
readlines.__doc__ = " Read the source code."
+noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search
def expand_indent(line):
@@ -1102,10 +1103,6 @@ def mute_string(text):
return text[:start] + 'x' * (end - start) + text[end:]
-def noqa(line):
- return line.strip().lower().endswith(('# noqa', '# nopep8'))
-
-
def parse_udiff(diff, patterns=None, parent='.'):
"""Return a dictionary of matching lines."""
# For each file of the diff, the entry key is the filename,