crytic / crytic/slither

[Tracking] Ideas for Printer CLI & API improvements

Open
#759 6 comments 1 reaction 0 assignees View on GitHub
High Priority tracking ux
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

A place to collect ideas for improving the printer system.

## CLI

- add `--filter {contract}` to only output results for the given `{contract}`
- reduces noise when just looking at a single contract
- requires printer system to be aware which outputs belong to which contract
- add `--filter {contract}.{function}` to only output results for the given `{function}` of `{contract}`
- allows to quickly find out things about a specific function
- requires printer system to be aware which outputs belong to which function
- Consider adding classification to the printers (for example `Function Explorer`, `Summary`, `SlithIR`, ...), and adding these categories to printer table (with an order by classification, and then name)
- copied from https://github.com/crytic/slither/issues/749
- add `--printer-doc {printer-id}` to output reference for given `{printer-id}`
- copied from https://github.com/crytic/slither/issues/749
- change `--markdown ""` to `--printers-wiki-markdown` and `--detectors-wiki-markdown`
- make `--json` output something that has more structure than a table

## API

- introduce way for printers to communicate that certain results belong to certain contracts and functions
- enables `--filter` (see above)
- enables better json output that has standardized grouping for contracts and functions and is easier to consume by other programs
- enables automated inclusion of source mapping in `--json` output which is needed if slither vscode plugin wants to display printer results inline
- Add the printer documentation to the python class (similar to what we have for the detectors). This will ensure we keep an up to date documentation for each printer and will let us update the wiki page entirely in one step (it's how we do it for detectors).
- copied from https://github.com/crytic/slither/issues/749
- remove param `filename` from `AbstractPrinter.output(...)` since printers generally ignore it and it is also available as `self.filename`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.