Hi,
Maybe I'm going about this the wrong way but trying to get the errors from stack into my editor:
I'm doing a inotifywait -m -o logschanged -e modify .stack-work/logs/
which watches the logs and records the files that have changed (these will contain the errors).
The output of that just looks like:
...
.stack-work/logs/ MODIFY model-0.0.0.log
.stack-work/logs/ MODIFY model-0.0.0.log
...
I was then hoping to run something like this
stack build --exec 'awk '!seen[$0]++' logschanged | grep "error\|warn" > .errors '
for when the build has finished (but failed)
which gets rid of the duplicates from the logs changed and then filters out just the error and warning lines... looks like this:
src/Types/BlahBlah.hs:20:39: error:
src/Types/Blah.hs:25:37: error:
src/Types/Err.hs:6:5: error:
src/Types/BlahErr.hs:20:5: error:
I think using this plugin from vim would then let you go straight to the right file and line number from that file... which would be pretty awesome.
Its not fully finished yet - the logschanged file needs periodically deleting but would allow a much speedier way of fixing errors when refactoring.
So what I'd like to do is add an option like --exec-fail 'blah' that is just like exec but runs on failure of the build rather than success.
I'd be happy to implement it if you can point me in the right direction.
Cheers
Jonny
Hi,
Maybe I'm going about this the wrong way but trying to get the errors from stack into my editor:
I'm doing a
inotifywait -m -o logschanged -e modify .stack-work/logs/which watches the logs and records the files that have changed (these will contain the errors).
The output of that just looks like:
I was then hoping to run something like this
stack build --exec 'awk '!seen[$0]++' logschanged | grep "error\|warn" > .errors 'for when the build has finished (but failed)
which gets rid of the duplicates from the logs changed and then filters out just the error and warning lines... looks like this:
I think using this plugin from vim would then let you go straight to the right file and line number from that file... which would be pretty awesome.
Its not fully finished yet - the logschanged file needs periodically deleting but would allow a much speedier way of fixing errors when refactoring.
So what I'd like to do is add an option like
--exec-fail 'blah'that is just like exec but runs on failure of the build rather than success.I'd be happy to implement it if you can point me in the right direction.
Cheers
Jonny