Validate all files under a path. Returns (checked, failed) counts.
(search_path: Path, errors: list, warnings: list)
| 161 | |
| 162 | |
| 163 | def validate_path(search_path: Path, errors: list, warnings: list) -> tuple[int, int]: |
| 164 | """Validate all files under a path. Returns (checked, failed) counts.""" |
| 165 | checked = 0 |
| 166 | failed = 0 |
| 167 | |
| 168 | # Validate .md files (skip README.md files) |
| 169 | for md_file in sorted(search_path.rglob("*.md")): |
| 170 | if md_file.name == "README.md": |
| 171 | continue |
| 172 | if ".vitepress" in str(md_file): |
| 173 | continue |
| 174 | checked += 1 |
| 175 | if not validate_md_file(md_file, errors, warnings): |
| 176 | failed += 1 |
| 177 | |
| 178 | # Validate _index.json files |
| 179 | for index_file in sorted(search_path.rglob("_index.json")): |
| 180 | checked += 1 |
| 181 | if not validate_index_file(index_file, errors, warnings): |
| 182 | failed += 1 |
| 183 | |
| 184 | return checked, failed |
| 185 | |
| 186 | |
| 187 | def main(): |
no test coverage detected