MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / validate_repository_path

Function validate_repository_path

codewiki/cli/utils/validation.py:132–153  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
148def 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

Callers 1

validate_repositoryFunction · 0.90

Calls 2

RepositoryErrorClass · 0.90
resolveMethod · 0.80

Tested by

no test coverage detected