(
config_layers: list[tuple[Path, dict[str, Any]]], config_profile: str | None
)
| 198 | |
| 199 | |
| 200 | def 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 | |
| 222 | def resolve_project_root(cwd: Path, config_layers: list[tuple[Path, dict[str, Any]]]) -> Path: |
no test coverage detected