check-code: support multiline matches like try/except/finally
- match one pattern at a time against entire file
- find line containing match
- sort matches by line number
#!/usr/bin/env python
# Filter output by the progress extension to make it readable in tests
import sys, re
for line in sys.stdin:
line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
sys.stdout.write(line)
print