From 4f09d238236c971602a00ef8a9e7992f243ba7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Wed, 7 Feb 2024 18:02:15 -0300 Subject: [PATCH] Make triage database path customizable --- slither/__main__.py | 10 +++++++++- slither/slither.py | 2 ++ slither/utils/command_line.py | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/slither/__main__.py b/slither/__main__.py index d1b36d951b..3cd914a87a 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -528,12 +528,20 @@ def parse_args( group_misc.add_argument( "--triage-mode", - help="Run triage mode (save results in slither.db.json)", + help="Run triage mode (save results in triage database)", action="store_true", dest="triage_mode", default=False, ) + group_misc.add_argument( + "--triage-database", + help="File path to the triage database (default: slither.db.json)", + action="store", + dest="triage_database", + default=defaults_flag_in_config["triage_database"], + ) + group_misc.add_argument( "--config-file", help="Provide a config file (default: slither.config.json)", diff --git a/slither/slither.py b/slither/slither.py index 747d2207ef..a3cc644042 100644 --- a/slither/slither.py +++ b/slither/slither.py @@ -135,7 +135,9 @@ def __init__(self, target: Union[str, CryticCompile], **kwargs) -> None: self._exclude_dependencies = kwargs.get("exclude_dependencies", False) triage_mode = kwargs.get("triage_mode", False) + triage_database = kwargs.get("triage_database", "slither.db.json") self._triage_mode = triage_mode + self._previous_results_filename = triage_database printers_to_run = kwargs.get("printers_to_run", "") if printers_to_run == "echidna": diff --git a/slither/utils/command_line.py b/slither/utils/command_line.py index 6c50fcab93..2432a21165 100644 --- a/slither/utils/command_line.py +++ b/slither/utils/command_line.py @@ -70,6 +70,7 @@ class FailOnLevel(enum.Enum): "no_fail": False, "sarif_input": "export.sarif", "sarif_triage": "export.sarif.sarifexplorer", + "triage_database": "slither.db.json", **DEFAULTS_FLAG_IN_CONFIG_CRYTIC_COMPILE, }