pull/179/head
Josselin 6 years ago
parent c6df387d7d
commit 58c138ee2b
  1. 10
      slither/__main__.py
  2. 11
      slither/utils/command_line.py

@ -19,7 +19,7 @@ from slither.printers import all_printers
from slither.printers.abstract_printer import AbstractPrinter
from slither.slither import Slither
from slither.utils.colors import red, yellow, set_colorization_enabled
from slither.utils.command_line import (output_detectors,
from slither.utils.command_line import (output_detectors, output_results_to_markdown,
output_detectors_json, output_printers,
output_to_markdown, output_wiki)
@ -422,6 +422,12 @@ def parse_args(detector_classes, printer_classes):
action=OutputMarkdown,
default=False)
group_misc.add_argument('--checklist',
help=argparse.SUPPRESS,
action='store_true',
default=False)
parser.add_argument('--wiki-detectors',
help=argparse.SUPPRESS,
action=OutputWiki,
@ -570,6 +576,8 @@ def main_impl(all_detector_classes, all_printer_classes):
if args.json:
output_json(results, args.json)
if args.checklist:
output_results_to_markdown(results)
# Dont print the number of result for printers
if number_contracts == 0:
logger.warn(red('No contract was analyzed'))

@ -1,4 +1,5 @@
import json
from collections import defaultdict
from prettytable import PrettyTable
from slither.detectors.abstract_detector import classification_txt
@ -49,6 +50,16 @@ def output_to_markdown(detector_classes, printer_classes, filter_wiki):
print('{} | `{}` | {}'.format(idx, argument, help_info))
idx = idx + 1
def output_results_to_markdown(all_results):
checks = defaultdict(list)
for results in all_results:
checks[results['check']].append(results['description'])
for (check, results) in checks.items():
print('####  {}'.format(check))
for result in results:
print(f' - [ ] {result}')
def output_wiki(detector_classes, filter_wiki):
detectors_list = []

Loading…
Cancel
Save