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
132def 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
156def detect_supported_languages(directory: Path) -> List[Tuple[str, int]]:

Callers 1

validate_repositoryFunction · 0.90

Calls 2

RepositoryErrorClass · 0.90
resolveMethod · 0.80

Tested by

no test coverage detected