Consensys / truffle-security

MythX smart contract security verification plugin for Truffle Framework
https://mythx.io
124 stars 28 forks source link

Option to create JSON only results #244

Closed thec00n closed 4 years ago

thec00n commented 4 years ago

Description

As a MythX user I would like to have a command line option the allows me retrieve the results of the analysis in JSON format so that I can post process them. In the current version there is a JSON output option --style json. The problem is that if STDOUT is used to fetch the JSON result it will also contain log output from truffle and other places.

Solution

Add an option to save the result in JSON format to a file and ensure it is JSON only.

area commented 4 years ago

We currently work around this by piping the output through grep: | grep '^\[{"' > truffle-security-output.json and then using that file as the input to our post processing.

thec00n commented 4 years ago

Thanks @area, nice work around.

Having an inbuilt option to return JSON only output is still something worth considering.

danielrea commented 4 years ago

Try adding --no-mythx-logs with version 1.6.2 and reopen if you have any issues.