mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-30 01:29:07 -05:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user