From 0c252decfe6085bf8b8d2e4325406dad15fc5352 Mon Sep 17 00:00:00 2001 From: Jacob Kraniak <113630934+jacob-kraniak@users.noreply.github.com> Date: Tue, 19 May 2026 21:36:56 -0400 Subject: [PATCH] chore: add scripts/validate-tool-tables.py --- scripts/validate-tool-tables.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/validate-tool-tables.py diff --git a/scripts/validate-tool-tables.py b/scripts/validate-tool-tables.py new file mode 100644 index 0000000..10b351d --- /dev/null +++ b/scripts/validate-tool-tables.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +""" +Tool Table Schema Validator +Enforces TOOL-TABLE-SCHEMA.md rules. +""" +import re +import sys +from pathlib import Path + +def main(): + errors = [] + for md_file in Path('.').rglob('tools/**/*.md'): + content = md_file.read_text(encoding='utf-8', errors='ignore') + # Simple header check + if '| Name | Vendor/Webpage | GitHub Repo | Brief Description | Tags | Latest Commit | Creation Date | Stars |' in content: + # Count columns in rows + rows = re.findall(r'\|\s*[^|]+\s*\|', content) + for row in rows: + if row.count('|') != 9: # 8 columns + separators + errors.append(f"Invalid row in {md_file}") + if errors: + print('\n'.join(errors)) + sys.exit(1) + print('✅ Tool tables validated.') + sys.exit(0) + +if __name__ == "__main__": + main() \ No newline at end of file