100 endPos = line.rfind(endComment) |
100 endPos = line.rfind(endComment) |
101 if endPos >= 0: |
101 if endPos >= 0: |
102 comment = comment[:endPos] |
102 comment = comment[:endPos] |
103 flags = [f.strip() for f in comment.split() |
103 flags = [f.strip() for f in comment.split() |
104 if (f.startswith("__") and f.endswith("__"))] |
104 if (f.startswith("__") and f.endswith("__"))] |
|
105 flags += [f.strip().lower() for f in comment.split() |
|
106 if f in ("noqa", "NOQA")] |
105 return flags |
107 return flags |
106 |
108 |
107 |
109 |
108 def syntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, |
110 def syntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, |
109 ignoreStarImportWarnings=False): |
111 ignoreStarImportWarnings=False): |
329 try: |
331 try: |
330 lineFlags += extractLineFlags(lines[lineno].strip(), |
332 lineFlags += extractLineFlags(lines[lineno].strip(), |
331 flagsLine=True) |
333 flagsLine=True) |
332 except IndexError: |
334 except IndexError: |
333 pass |
335 pass |
334 if "__IGNORE_WARNING__" not in lineFlags: |
336 if "__IGNORE_WARNING__" not in lineFlags and \ |
|
337 "noqa" not in lineFlags: |
335 results.append((_fn, lineno, col, "", message, msg_args)) |
338 results.append((_fn, lineno, col, "", message, msg_args)) |
336 except SyntaxError as err: |
339 except SyntaxError as err: |
337 if err.text.strip(): |
340 if err.text.strip(): |
338 msg = err.text.strip() |
341 msg = err.text.strip() |
339 else: |
342 else: |