Skip to content

Commit 03fd103

Browse files
Ian Massinghamclaude
andauthored
ci: add JSON validation to make check (#82)
Add check/json target that validates all JSON files in the repository using jq. This will catch malformed JSON files, including git conflict markers, before they are committed. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a7b16cf commit 03fd103

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fix: ## Fix project.
9292
@uv run ruff check --fix --unsafe-fixes
9393

9494
.PHONY: check
95-
check: check/format check/lint check/types ## Run all checks.
95+
check: check/format check/lint check/types check/json ## Run all checks.
9696

9797
.PHONY: check/format
9898
check/format:
@@ -106,6 +106,14 @@ check/lint:
106106
check/types:
107107
@uv run pyright .
108108

109+
.PHONY: check/json
110+
check/json: ## Validate JSON files.
111+
@echo "Checking JSON files..."
112+
@find . -name "*.json" -type f \
113+
! -path "./.venv/*" \
114+
! -path "./node_modules/*" \
115+
-exec sh -c 'jq empty "{}" > /dev/null 2>&1 || (echo "Invalid JSON: {}" && exit 1)' \;
116+
109117
.PHONY: test
110118
test: ## Run all tests.
111119
@uv run pytest tests/

0 commit comments

Comments
 (0)