-
Notifications
You must be signed in to change notification settings - Fork 970
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
Opt-in JSON result types + JSON fields for console log/compilation #266
Conversation
-JSON result output cleanup
…rr (needed for outputting JSON to file, which retains output to console as well).
…ult output options. -Console output in JSON is now optional via --json-types -Detector types can be listed via --json-types now (retained --list-detectors-json for compatibility, to be deprecated later).
Commit e85848b adds support for an argument Current types include:
Additional TODOs for this PR:
|
slither/__main__.py
Outdated
else: | ||
for filename in filenames: | ||
(results_tmp, number_contracts_tmp) = process(filename, args, detector_classes, printer_classes) | ||
(slither, results_tmp, number_contracts_tmp) = process(filename, args, detector_classes, printer_classes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the slither
will not be correct here, as it is a loop.
The variable seems to be only used for the compilation
output. I am not sure about keeping this output, as it's a duplicate of crytic-compile
standard export format, without following the same json format.
I think we should either, we drop compilation
here, or we create crytic_compile.export_json
, that we store into a compilations
list. Any thought?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I wouldn't drop compilation
entirely. External tooling such as VSCode might find it useful to have all of this information, and might not be able to compile all of the build configurations which crytic-compile
can on its own. Additionally, running a separate compilation process outside of slither
would eat up too much time.
I'm fine with aggregating all the compilation information in this loop and forwarding JSON output from crytic-compile
into slither
JSON output as you had mentioned, as long as we output the same data and don't dump to disk in crytic-compile
and then read it in slither
(as disk I/O would be slow, ugly).
Since different JSON output types are optional, we can turn compilation
off if we feel its too bloating, but it seems easy to offer such information, if desired. Does that make sense or do you think maybe we should re-evaluate something here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has been updated to change compilations
into an array of all the compilations which took place (a globbed filename will many compilations + slither instances to analyze each target). Each compilation uses crytic-compile's standard export format now.
-Rewrote main entry point to move glob pattern matching and other compilation into crytic compile.
Support for crytic-compile exported archives + simplified main entry point
Changes:
|
This pull request aims to resolve #247 . It improves upon the way JSON results are output with the
--json
argument by cleaning up the way results are constructed and including stdout/stderr output in the JSON results.Changes:
slither/utils/output_capture.py
: Used to redirect/mirror stdout/stderr output descriptors forprint()
statements andlogging
calls (which store stdout/stderr upon initialization and need swapping).stdout
andstderr
fields under theresults
field in JSON output.This is marked as WIP until the following tasks are completed: