MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / validate_path

Function validate_path

scripts/validate_schema.py:163–184  ·  view source on GitHub ↗

Validate all files under a path. Returns (checked, failed) counts.

(search_path: Path, errors: list, warnings: list)

Source from the content-addressed store, hash-verified

161
162
163def 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
187def main():

Callers 1

mainFunction · 0.85

Calls 2

validate_md_fileFunction · 0.85
validate_index_fileFunction · 0.85

Tested by

no test coverage detected