elm-analyse icon indicating copy to clipboard operation
elm-analyse copied to clipboard

Add support for outputting json to a file

Open jhf opened this issue 6 years ago • 4 comments

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.

jhf avatar Apr 11 '19 03:04 jhf

I see some tests are failing, I'll look into that.

jhf avatar Apr 11 '19 15:04 jhf

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?

stil4m avatar Jul 10 '19 06:07 stil4m

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?

jhf avatar Sep 04 '19 19:09 jhf

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 :(.

stil4m avatar Sep 05 '19 07:09 stil4m