Validate repository path exists and contains code files. Args: path: Repository path to validate Returns: Validated Path object Raises: RepositoryError: If repository is invalid
(path: Path)
| 130 | |
| 131 | |
| 132 | def validate_repository_path(path: Path) -> Path: |
| 133 | """ |
| 134 | Validate repository path exists and contains code files. |
| 135 | |
| 136 | Args: |
| 137 | path: Repository path to validate |
| 138 | |
| 139 | Returns: |
| 140 | Validated Path object |
| 141 | |
| 142 | Raises: |
| 143 | RepositoryError: If repository is invalid |
| 144 | """ |
| 145 | path = Path(path).expanduser().resolve() |
| 146 | |
| 147 | if not path.exists(): |
| 148 | raise RepositoryError(f"Repository path does not exist: {path}") |
| 149 | |
| 150 | if not path.is_dir(): |
| 151 | raise RepositoryError(f"Repository path is not a directory: {path}") |
| 152 | |
| 153 | return path |
| 154 | |
| 155 | |
| 156 | def detect_supported_languages(directory: Path) -> List[Tuple[str, int]]: |
no test coverage detected