Skip to content

Commit

Permalink
add config option for hiding/showing reports of modules where score i…
Browse files Browse the repository at this point in the history
…s 100%
  • Loading branch information
leondz committed Jul 29, 2024
1 parent 9070211 commit 5e26de8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions garak/analyze/report_digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;"
)
Expand Down
3 changes: 2 additions & 1 deletion garak/resources/garak.core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ plugins:
reporting:
report_prefix:
taxonomy:
report_dir: garak_runs
report_dir: garak_runs
show_100_pass_modules: true
1 change: 0 additions & 1 deletion tests/analyze/test_analyze.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 5e26de8

Please sign in to comment.