1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Reorganized layout of CI directory, move all before_install files into

common directory, remove copy-pasted files
This commit is contained in:
Ivan Savenko
2024-09-06 16:54:49 +00:00
parent 289ed742d0
commit ecf063cd1c
17 changed files with 20 additions and 31 deletions

28
CI/validate_json.py Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python3
import re
import sys
from pathlib import Path
from pprint import pprint
# VCMI supports JSON with comments, but not JSON5
import jstyleson
validation_failed = False
for path in sorted(Path(".").glob("**/*.json"), key=lambda path: str(path).lower()):
# because path is an object and not a string
path_str = str(path)
if path_str.startswith("."):
continue
try:
with open(path_str, "r") as file:
jstyleson.load(file)
print(f"{path_str}")
except Exception as exc:
print(f"{path_str}: {exc}")
validation_failed = True
if validation_failed:
sys.exit(1)