MCPcopy Create free account
hub / github.com/openai/plugins / iter_config_views

Function iter_config_views

plugins/codex-security/scripts/config_preflight.py:200–219  ·  view source on GitHub ↗
(
    config_layers: list[tuple[Path, dict[str, Any]]], config_profile: str | None
)

Source from the content-addressed store, hash-verified

198
199
200def iter_config_views(
201 config_layers: list[tuple[Path, dict[str, Any]]], config_profile: str | None
202) -> Iterator[tuple[str, dict[str, Any]]]:
203 for config_path, config in reversed(config_layers):
204 if config_profile is not None:
205 profiles = config.get("profiles")
206 if isinstance(profiles, dict):
207 profile_config = profiles.get(config_profile)
208 if isinstance(profile_config, dict):
209 supported_profile_config = {
210 key: value
211 for key, value in profile_config.items()
212 if key in LEGACY_CONFIG_PROFILE_CAPABILITY_FIELDS
213 }
214 if supported_profile_config:
215 yield (
216 f"{config_path} [profiles.{config_profile}]",
217 supported_profile_config,
218 )
219 yield str(config_path), config
220
221
222def resolve_project_root(cwd: Path, config_layers: list[tuple[Path, dict[str, Any]]]) -> Path:

Callers 2

lookup_config_valueFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected