MCPcopy
hub / github.com/usestrix/strix / load_settings

Function load_settings

strix/config/loader.py:29–45  ·  view source on GitHub ↗

Resolve settings from env + JSON file + defaults. Memoized. Precedence: env vars win, then the JSON file, then field defaults.

()

Source from the content-addressed store, hash-verified

27
28
29def load_settings() -> Settings:
30 """Resolve settings from env + JSON file + defaults. Memoized.
31
32 Precedence: env vars win, then the JSON file, then field defaults.
33 """
34 global _cached # noqa: PLW0603
35 if _cached is None:
36 source_path = _override or _DEFAULT_PATH
37 init_kwargs: dict[str, Any] = _read_json_overrides(source_path)
38 _cached = Settings(**init_kwargs)
39 logger.debug(
40 "load_settings: resolved (override=%s, file_used=%s, json_keys=%d)",
41 _override is not None,
42 source_path.exists(),
43 sum(len(v) for v in init_kwargs.values()),
44 )
45 return _cached
46
47
48def apply_config_override(path: Path) -> None:

Callers 15

_do_searchFunction · 0.90
_is_enabledFunction · 0.90
_is_enabledFunction · 0.90
_resolve_sandbox_imageFunction · 0.90
build_live_stats_textFunction · 0.90
build_tui_stats_textFunction · 0.90
validate_environmentFunction · 0.90
warm_up_llmFunction · 0.90
pull_docker_imageFunction · 0.90
mainFunction · 0.90
scan_targetMethod · 0.90
run_strix_scanFunction · 0.90

Calls 2

SettingsClass · 0.90
_read_json_overridesFunction · 0.85

Tested by

no test coverage detected