Detect repository information from git. Args: repo_path: Repository path Returns: Dictionary with 'name', 'url', 'github_pages_url'
(self, repo_path: Path)
| 236 | commit_short = info["commit_id"][:8] |
| 237 | html_parts.append( |
| 238 | f'<div class="info-row"><strong>Commit:</strong> {commit_short}</div>' |
| 239 | ) |
| 240 | |
| 241 | if stats.get("total_components"): |
| 242 | components_str = f"{stats['total_components']:,}" |
| 243 | html_parts.append( |
| 244 | f'<div class="info-row"><strong>Components:</strong> {components_str}</div>' |
| 245 | ) |
| 246 | |
| 247 | if stats.get("max_depth"): |
| 248 | html_parts.append( |
| 249 | f'<div class="info-row"><strong>Max Depth:</strong> {stats["max_depth"]}</div>' |
| 250 | ) |
| 251 | |
| 252 | return "\n ".join(html_parts) |
| 253 | |
| 254 | def _escape_html(self, text: str) -> str: |
| 255 | """ |
| 256 | Escape HTML special characters. |
| 257 | |
| 258 | Args: |
| 259 | text: Text to escape |
| 260 | |
| 261 | Returns: |
| 262 | Escaped text |
| 263 | """ |
| 264 | return ( |
| 265 | text.replace("&", "&") |
| 266 | .replace("<", "<") |
| 267 | .replace(">", ">") |
| 268 | .replace('"', """) |
| 269 | .replace("'", "'") |
| 270 | ) |
| 271 | |
| 272 | def detect_repository_info(self, repo_path: Path) -> Dict[str, Optional[str]]: |
| 273 | """ |
| 274 | Detect repository information from git. |
| 275 | |
| 276 | Args: |
| 277 | repo_path: Repository path |
| 278 | |
| 279 | Returns: |
| 280 | Dictionary with 'name', 'url', 'github_pages_url' |
| 281 | """ |
| 282 | info = { |
| 283 | "name": repo_path.name, |
| 284 | "url": None, |
| 285 | "github_pages_url": None, |
| 286 | } |
no outgoing calls
no test coverage detected