Last active
June 8, 2016 10:12
-
-
Save chtenb/5f4f808c42040ef1a8a768742ff612bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from shellout import out | |
errors = out('cat errors.txt') | |
regex = re.compile(r"\[(?P<filename>[^:]+):(?P<linenumber>\d+)\]: \(performance\) " | |
"Function parameter '(?P<argumentname>[^']+)'") | |
matches = regex.findall(errors) | |
for match in matches: | |
d = match.groupdict() | |
filename = d['filename'] | |
linenumber = d['linenumber'] | |
argumentname = d['argumentname'] | |
print(filename, linenumber, argumentname) | |
command = r'fate -c ":{}\n/{}\ni&<esc>" "{}"' | |
out(command, int(linenumber) - 1, argumentname, filename, verbose=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment