2011-05-01 17:22:30 +04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
# Filter output by pyflakes to control which warnings we check
|
|
|
|
|
2016-04-02 17:35:02 +03:00
|
|
|
from __future__ import absolute_import, print_function
|
2015-12-07 09:22:09 +03:00
|
|
|
|
|
|
|
import re
|
|
|
|
import sys
|
2011-05-01 17:22:30 +04:00
|
|
|
|
2011-05-01 20:56:27 +04:00
|
|
|
lines = []
|
2011-05-01 17:22:30 +04:00
|
|
|
for line in sys.stdin:
|
2016-11-11 00:49:42 +03:00
|
|
|
# We blacklist tests that are too noisy for us
|
2011-05-01 19:27:41 +04:00
|
|
|
pats = [
|
2016-11-11 00:49:42 +03:00
|
|
|
r"undefined name '(WindowsError|memoryview)'",
|
|
|
|
r"redefinition of unused '[^']+' from line",
|
|
|
|
]
|
|
|
|
|
|
|
|
keep = True
|
|
|
|
for pat in pats:
|
|
|
|
if re.search(pat, line):
|
|
|
|
keep = False
|
2013-06-27 01:12:55 +04:00
|
|
|
break # pattern matches
|
2016-11-11 00:49:42 +03:00
|
|
|
if keep:
|
|
|
|
fn = line.split(':', 1)[0]
|
|
|
|
f = open(fn)
|
|
|
|
data = f.read()
|
|
|
|
f.close()
|
|
|
|
if 'no-' 'check-code' in data:
|
|
|
|
continue
|
|
|
|
lines.append(line)
|
|
|
|
|
|
|
|
for line in lines:
|
2011-05-01 17:22:30 +04:00
|
|
|
sys.stdout.write(line)
|
2016-04-02 17:35:02 +03:00
|
|
|
print()
|
2014-05-09 03:44:53 +04:00
|
|
|
|
|
|
|
# self test of "undefined name" detection for other than 'memoryview'
|
|
|
|
if False:
|
2016-11-11 00:49:42 +03:00
|
|
|
print(memoryview)
|
2016-04-02 17:35:02 +03:00
|
|
|
print(undefinedname)
|