(cwd: Path, config_layers: list[tuple[Path, dict[str, Any]]])
| 220 | |
| 221 | |
| 222 | def resolve_project_root(cwd: Path, config_layers: list[tuple[Path, dict[str, Any]]]) -> Path: |
| 223 | found, configured_markers = lookup_layered_value("project_root_markers", config_layers) |
| 224 | markers = configured_markers if found else [".git"] |
| 225 | if not isinstance(markers, list) or not all(isinstance(marker, str) for marker in markers): |
| 226 | raise ValueError("project_root_markers must be an array of strings") |
| 227 | if not markers: |
| 228 | return cwd |
| 229 | for candidate in (cwd, *cwd.parents): |
| 230 | if any((candidate / marker).exists() for marker in markers): |
| 231 | return candidate |
| 232 | return cwd |
| 233 | |
| 234 | |
| 235 | def project_trust_level( |
no test coverage detected