Skip to content

Instantly share code, notes, and snippets.

@alexgarel
Created October 17, 2013 07:07
Show Gist options
  • Save alexgarel/7020353 to your computer and use it in GitHub Desktop.
Save alexgarel/7020353 to your computer and use it in GitHub Desktop.
Using Geany and launching jshint ? This script parse jshint output and add line filename and line numbers and produce an output suitable for Geany (underlining errors and jumping to related line as you cilck on jshint ouput).
#!/usr/bin/env python3
"""
Geany jshint output reformater
When defining your compile command in geany
just use /path/to/jshint %f |/path/to/reformat_jshint.py
"""
import re
import sys
line_indic = re.compile(r": line (?P<line>\d+), col (?P<col>\d+),")
while True:
l = sys.stdin.readline()
if not l:
break
print(line_indic.sub(':\g<line>:\g<col>:', l), end='')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment