capa
capa copied to clipboard
read and render results document
when wanting to display different output modes, e.g. plain or verbose, the whole program needs to run again
with the results document saved by the user, we could also take that as an input and render per the specified arguments
alternatively/additionally, we could think about a "workspace option" combining the results and/or freeze output (underused, currently I think) to speed up subsequent runs
uses cases for this would be:
- rule dev
- results exploration
this will require a bit of refactoring so let's agree if this is worth it and how to do it, first
rendering an existing results document is a great idea!
Could you please explain it a bit more and guide me how to do it ?
For the rendering of an existing result document (JSON), we'll have to:
- find a good way to provide the result file to capa
- render the loaded results per the arguments
@williballenthin is adding a new format FORMAT_RESULT a correct approach as by this we can reuse args.sample to accept json file as cited by @mr-tz ,and rather than --format=result we can just compare the initial buf.read of the file to be {"meta": to ensure its a results.json file
Yes, an explicit new FORMAT and auto-detection via the first few bytes (and subquential successful loading) sound great.
Hi @mr-tz -tz ,I would like to work on fixing issue. I would appreciate your guidance as I work on this issue. Let me know if you have any suggestions or guidance on how I can get started. Thank you!
No, @ooprathamm is working on this in #1396 so let’s follow their work and lend a hand if they ask for help. Otherwise, is feature is already being addressed.