Created
June 8, 2016 10:04
-
-
Save chtenb/0c804418d32745f5e088edc093bc104e 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 get, out | |
errors = get('cat errors.txt') | |
# Fix missing explicit keyword using vim | |
# Where explicit.vim contains: | |
# exe "normal 0wiexplicit \<esc>" | |
# wq | |
try: | |
regex = re.compile(r'\[(?P<filename>[^:]+):(?P<linenumber>\d+)') | |
matches = regex.findall(errors) | |
for match in matches: | |
d = match.groupdict() | |
filename = d['filename'] | |
linenumber = d['linenumber'] | |
print(filename, linenumber) | |
out(r'vim -T dumb -N -u NONE +{} -c "set nomore" -S explicit.vim "{}"', | |
linenumber, filename, verbose=True) | |
finally: | |
out('clear') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment