From bc1cb0df2dd3041cbe3c46228a36054a70eb0833 Mon Sep 17 00:00:00 2001 From: Eric Rafaloff Date: Wed, 12 Jun 2019 12:22:11 -0400 Subject: [PATCH] Add --exclude-optimization flag --- slither/__main__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/slither/__main__.py b/slither/__main__.py index a1b4ce4ad..52a0fc4ca 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -203,6 +203,10 @@ def choose_detectors(args, all_detector_classes): detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) return detectors_to_run + if args.exclude_optimization: + detectors_to_run = [d for d in detectors_to_run if + d.IMPACT != DetectorClassification.OPTIMIZATION] + if args.exclude_informational: detectors_to_run = [d for d in detectors_to_run if d.IMPACT != DetectorClassification.INFORMATIONAL] @@ -260,6 +264,7 @@ defaults_flag_in_config = { 'printers_to_run': None, 'detectors_to_exclude': None, 'exclude_dependencies': False, + 'exclude_optimization': False, 'exclude_informational': False, 'exclude_low': False, 'exclude_medium': False, @@ -337,6 +342,11 @@ def parse_args(detector_classes, printer_classes): action='store_true', default=defaults_flag_in_config['exclude_dependencies']) + group_detector.add_argument('--exclude-optimization', + help='Exclude optimization analyses', + action='store_true', + default=defaults_flag_in_config['exclude_optimization']) + group_detector.add_argument('--exclude-informational', help='Exclude informational impact analyses', action='store_true',