Recursively get all supported files in a repository
(self, repo_path: Path)
| 543 | self.logger.warning(f"Failed to save debug response: {e}") |
| 544 | |
| 545 | def get_all_repo_files(self, repo_path: Path) -> List[Path]: |
| 546 | """Recursively get all supported files in a repository""" |
| 547 | files = [] |
| 548 | |
| 549 | try: |
| 550 | for root, dirs, filenames in os.walk(repo_path): |
| 551 | # Skip common non-code directories |
| 552 | dirs[:] = [ |
| 553 | d |
| 554 | for d in dirs |
| 555 | if not d.startswith(".") and d not in self.skip_directories |
| 556 | ] |
| 557 | |
| 558 | for filename in filenames: |
| 559 | file_path = Path(root) / filename |
| 560 | if file_path.suffix.lower() in self.supported_extensions: |
| 561 | files.append(file_path) |
| 562 | |
| 563 | except Exception as e: |
| 564 | self.logger.error(f"Error traversing {repo_path}: {e}") |
| 565 | |
| 566 | return files |
| 567 | |
| 568 | def generate_file_tree(self, repo_path: Path, max_depth: int = 5) -> str: |
| 569 | """Generate file tree structure string for the repository""" |