-
Notifications
You must be signed in to change notification settings - Fork 28
Add the option to write the results to a JSON file #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I closed the previous pull request because it was causing a huge diff, due to changes in line endings. |
|
Hi @cgkantidis ! Thank you for your contribution. I've looked at your PR briefly, and it looks nice. I didn't know cmake has package support. I'll look into it a bit more over the weekend. Generally I think we can include libraries now that the build is done using GitHub actions, so no issue. It would be great if you can make the Windows build green too (probably lacks a header include only). |
|
Thanks @dlidstrom ! Indeed I had to include the There seems to be an issue with CI now, because it can't create a new tag. It seems like some kind of permission issue? Not sure. Please let me know if there's something I can do from my side. |
dd62a51 to
16c2c83
Compare
JSON has wider support than XML across programming languages, so I believe having the option to write the findings in a JSON format make Duplo more versatile, since its output can be consumed by many more tools. I chose to support JSON by adding a dependancy to the nlohmann/json header-only library, which handles escaping of the lines correctly. This has the drawback that we keep all the findings in memory (in a `json` object) instead of writing them directly to the output file. If this is considered a deal-breaker, we can re-implement all the escaping of the lines ourselves, as is done for XML, and write directly to the output file.
6cfdefe to
b8d8c43
Compare
|
Hi @dlidstrom, I resolved the conflict with the other pull requests, and I also added a test for the json output. |
|
This is looking great to me. A big thanks for taking the time to add a test too! |
JSON has wider support than XML across programming languages, so I believe having the option to write the findings in a JSON format make Duplo more versatile, since its output can be consumed by many more tools.
I chose to support JSON by adding a dependancy to the nlohmann/json header-only library, which handles escaping of the lines correctly.
This has the drawback that we keep all the findings in memory (in a
jsonobject) instead of writing them directly to the output file.If this is considered a deal-breaker, we can re-implement all the escaping of the lines ourselves, as is done for XML, and write directly to the output file.