Skip to content

Commit 0da6a9e

Browse files
committed
Add yamllint tomllint and jsonlint targets
1 parent 00877ad commit 0da6a9e

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,39 @@ check-manifest: ## 📦 Verify MANIFEST.in completeness
451451
@echo "📦 Verifying MANIFEST.in completeness…"
452452
check-manifest
453453

454+
# -----------------------------------------------------------------------------
455+
# 📑 YAML / JSON / TOML LINTERS
456+
# -----------------------------------------------------------------------------
457+
# help: yamllint - Lint YAML files (uses .yamllint)
458+
# help: jsonlint - Validate every *.json file with jq (‐‐exit-status)
459+
# help: tomllint - Validate *.toml files with tomlcheck
460+
#
461+
# ➊ Add the new linters to the master list
462+
LINTERS += yamllint jsonlint tomllint
463+
464+
# ➋ Individual targets
465+
.PHONY: yamllint jsonlint tomllint
466+
467+
yamllint: ## 📑 YAML linting
468+
@command -v yamllint >/dev/null 2>&1 || { \
469+
echo '❌ yamllint not installed ➜ pip install yamllint'; exit 1; }
470+
@echo '📑 yamllint …' && yamllint -c .yamllint .
471+
472+
jsonlint: ## 📑 JSON validation (jq)
473+
@command -v jq >/dev/null 2>&1 || { \
474+
echo '❌ jq not installed ➜ sudo apt-get install jq'; exit 1; }
475+
@echo '📑 jsonlint (jq) …'
476+
@find . -type f -name '*.json' -not -path './node_modules/*' -print0 \
477+
| xargs -0 -I{} sh -c 'jq empty "{}"' \
478+
&& echo '✅ All JSON valid'
479+
480+
tomllint: ## 📑 TOML validation (tomlcheck)
481+
@command -v tomlcheck >/dev/null 2>&1 || { \
482+
echo '❌ tomlcheck not installed ➜ pip install tomlcheck'; exit 1; }
483+
@echo '📑 tomllint (tomlcheck) …'
484+
@find . -type f -name '*.toml' -print0 \
485+
| xargs -0 -I{} tomlcheck "{}"
486+
454487
# =============================================================================
455488
# 🕸️ WEBPAGE LINTERS & STATIC ANALYSIS
456489
# =============================================================================

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ dev = [
118118
"settings-doc>=4.3.2",
119119
"snakeviz>=2.2.2",
120120
"ty>=0.0.1a6",
121+
"tomlcheck>=0.2.3",
121122
"twine>=6.1.0",
122123
"types-tabulate>=0.9.0.20241207",
123124
]
@@ -228,6 +229,7 @@ ignore_unused = [
228229
"importchecker",
229230
"isort",
230231
"ty",
232+
"tomlcheck",
231233
"mypy",
232234
"pexpect",
233235
"pip-licenses",

0 commit comments

Comments
 (0)