refactor(lint): use Python built-in json module for validation

Replaced external check-json hook with custom validator using Python's
built-in json module (json.load). Created validate_json.py wrapper to
handle multiple files.

Benefits:
- No external dependencies
- Uses Python's standard library json parser
- Same validation logic as the build system
- Fast and reliable (0.16s for all JSON files)
This commit is contained in:
Vijay Janapa Reddi
2025-11-10 13:23:15 -05:00
parent fd96039400
commit 1bb5aac313
2 changed files with 28 additions and 9 deletions

View File

@@ -78,17 +78,16 @@ repos:
# PHASE 2: BASIC VALIDATORS (Structure and syntax)
# =============================================================================
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# --- JSON Validation ---
- id: check-json
name: "Validate JSON files"
files: \.json$
description: "Validate all JSON files have correct syntax"
- repo: local
hooks:
# --- JSON Validation ---
- id: validate-json
name: "Validate JSON files"
entry: python tools/scripts/utilities/validate_json.py
language: python
files: \.json$
pass_filenames: true
description: "Validate all JSON files have correct syntax using Python's built-in json module"
# --- Project Structure Check ---
- id: check-project-structure
name: "Check required project files exist"