diff --git a/garak/analyze/report_digest.py b/garak/analyze/report_digest.py index 6f11c3eab..295f3c348 100644 --- a/garak/analyze/report_digest.py +++ b/garak/analyze/report_digest.py @@ -15,7 +15,8 @@ from garak import _config -SHOW_100_PERCENT_MODULES = True +if not _config.loaded: + _config.load_config() templateLoader = jinja2.FileSystemLoader( searchpath=_config.transient.basedir / "analyze" / "templates" @@ -176,7 +177,7 @@ def compile_digest(report_path, taxonomy=_config.reporting.taxonomy): } ) - if SHOW_100_PERCENT_MODULES or top_score < 100.0: + if top_score < 100.0 or _config.reporting.show_100_pass_modules: res = cursor.execute( f"select probe_module, probe_class, avg(score)*100 as s from results where probe_group='{probe_group}' group by probe_class order by s asc, probe_class asc;" ) diff --git a/garak/resources/garak.core.yaml b/garak/resources/garak.core.yaml index 75670a530..02d765308 100644 --- a/garak/resources/garak.core.yaml +++ b/garak/resources/garak.core.yaml @@ -34,4 +34,5 @@ plugins: reporting: report_prefix: taxonomy: - report_dir: garak_runs \ No newline at end of file + report_dir: garak_runs + show_100_pass_modules: true \ No newline at end of file diff --git a/tests/analyze/test_analyze.py b/tests/analyze/test_analyze.py index df93dd31d..6ecd4e59f 100644 --- a/tests/analyze/test_analyze.py +++ b/tests/analyze/test_analyze.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -import os import subprocess import sys