Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable nested setting of plugin configs #773

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions garak/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# logging should be set up before config is loaded

from collections import defaultdict
from dataclasses import dataclass
import importlib
import logging
Expand Down Expand Up @@ -60,11 +61,13 @@ class TransientConfig(GarakSubConfig):
run = GarakSubConfig()
plugins = GarakSubConfig()
reporting = GarakSubConfig()
plugins.probes = {}
plugins.generators = {}
plugins.detectors = {}
plugins.buffs = {}
plugins.harnesses = {}

nested_dict = lambda: defaultdict(nested_dict)
plugins.probes = nested_dict()
plugins.generators = nested_dict()
plugins.detectors = nested_dict()
plugins.buffs = nested_dict()
plugins.harnesses = nested_dict()
reporting.taxonomy = None # set here to enable report_digest to be called directly

buffmanager = BuffManager()
Expand Down
Loading