Add support for outputting json to a file
This solves the problem of console messages, such as Fetching package information from... appearing in the json, that breaks json parsing tools.
I'd be happy to do it in another fashion if that's required.
I see some tests are failing, I'll look into that.
Thanks @jhf for your PR.
If I understand correctly you are currently running elm-analyse --format=json, but the output of the process is not correct JSON. For the simplicity of the tool I would suggest to suppress the messages that corrupt the JSON output if the flag is set. This is already done for other messages ('file loading' and such).
Having to write to a file brings complexity with it, such as access, intermediate folders which have to be created, and in this case additional configuration in the process.
Would it suffice for you if the human readable messages are suppressed?
Thanks @jhf for your PR.
You are welcome.
If I understand correctly you are currently running
elm-analyse --format=json, but the output of the process is not correct JSON. For the simplicity of the tool I would suggest to suppress the messages that corrupt the JSON output if the flag is set. This is already done for other messages ('file loading' and such).
Ok.
Having to write to a file brings complexity with it, such as access, intermediate folders which have to be created, and in this case additional configuration in the process.
Yes, good point.
Would it suffice for you if the human readable messages are suppressed?
Certainly, are you, @stil4m, taking a stab at removing Fetching package information from... or do you wan't an updated PR?
If you can update the PR, that would be really cool. I do not have much time on my hands at this moment for this project :(.