vim/compiler/cake-test-wrapper.py @ ab4a7458c22c
Fix lispindent to indent flet/labels right so I don't lose my goddamn mind This code is an incomprehensible hellscape so this probably breaks something somewhere but if I have to spend another moment without correctly-indented flets and labelses I'm gonna jump out a fucking window.
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Fri, 25 Mar 2016 21:34:05 +0000 |
| parents | e86cb5d0cd4d |
| children | (none) |
#!/usr/bin/env python import os, subprocess def parse_filename(l): ns = l.split(' ', 3)[-1].rsplit('/', 1)[0] return os.path.join('./test', *ns.split('.')) + '.clj' def process_error(fn, l, lines): lnum = int(l.rsplit(' ', 1)[-1].split(':')[-1]) message = lines.pop(0) print '%s:%d:%s' % (fn, lnum, message) return message if __name__ == '__main__': out = subprocess.check_output(r"cake test | perl -pe 's/\e\[?.*?[\@-~]//g'", shell=True) prev = "" fn = None lines = out.splitlines() while lines: l = lines.pop(0) if l.startswith('cake test ') and '/' in l: fn = parse_filename(l) if l.startswith('FAIL!'): prev = process_error(fn, l, lines) else: prev = l