Re-scan the repo and build a :class:`ValidationReport`. Steps: 1. Discover all text files and count them by extension. 2. Run :func:`scan_repo` with the default :data:`SCAN_PATTERNS` to detect any remaining issues. 3. Populate the report with remaining issues grouped by type.
(repo_root: str | Path)
| 41 | |
| 42 | |
| 43 | def validate_fixes(repo_root: str | Path) -> ValidationReport: |
| 44 | """Re-scan the repo and build a :class:`ValidationReport`. |
| 45 | |
| 46 | Steps: |
| 47 | 1. Discover all text files and count them by extension. |
| 48 | 2. Run :func:`scan_repo` with the default :data:`SCAN_PATTERNS` to |
| 49 | detect any remaining issues. |
| 50 | 3. Populate the report with remaining issues grouped by type. |
| 51 | |
| 52 | Parameters |
| 53 | ---------- |
| 54 | repo_root: |
| 55 | Path to the repository root directory. |
| 56 | |
| 57 | Returns |
| 58 | ------- |
| 59 | ValidationReport |
| 60 | A report summarising the validation results. |
| 61 | """ |
| 62 | root = Path(repo_root).resolve() |
| 63 | |
| 64 | # 1. Count files by extension |
| 65 | total_files_scanned = count_files_by_extension(root) |
| 66 | |
| 67 | # 2. Re-scan for remaining issues |
| 68 | remaining = scan_repo(root, SCAN_PATTERNS) |
| 69 | |
| 70 | # 3. Build the report |
| 71 | report = ValidationReport( |
| 72 | total_files_scanned=total_files_scanned, |
| 73 | remaining_issues=remaining, |
| 74 | ) |
| 75 | |
| 76 | if remaining: |
| 77 | logger.warning( |
| 78 | "Validation found %d remaining issue(s) after fixes.", |
| 79 | len(remaining), |
| 80 | ) |
| 81 | else: |
| 82 | logger.info("Validation passed — zero remaining issues.") |
| 83 | |
| 84 | return report |