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 | Returns: |
| 132 | Validated Path object |
| 133 | |
| 134 | Raises: |
| 135 | RepositoryError: If repository is invalid |
| 136 | """ |
| 137 | path = Path(path).expanduser().resolve() |
| 138 | |
| 139 | if not path.exists(): |
| 140 | raise RepositoryError(f"Repository path does not exist: {path}") |
| 141 | |
| 142 | if not path.is_dir(): |
| 143 | raise RepositoryError(f"Repository path is not a directory: {path}") |
| 144 | |
| 145 | return path |
| 146 | |
| 147 | |
| 148 | def detect_supported_languages(directory: Path) -> list[tuple[str, int]]: |
| 149 | """ |
| 150 | Detect supported programming languages in a directory. |
| 151 | |
| 152 | Args: |
| 153 | directory: Directory to scan |
| 154 | |
| 155 | Returns: |
| 156 | List of (language, file_count) tuples |
no test coverage detected