We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 716860e commit 5daf766Copy full SHA for 5daf766
.github/validate_json.py
@@ -1,8 +1,7 @@
1
-import json
+import jstyleson
2
import glob
3
import os
4
import sys
5
-import urllib.request
6
7
from ignore_json import ignore
8
@@ -11,14 +10,16 @@
11
10
for filename in glob.glob(os.path.join('.', '*.json')):
12
if filename not in ignore:
13
print(f"Opening: {filename}")
14
- filecontent = open(filename, "r").read()
+
+ with open(filename, "r") as file:
15
+ filecontent = file.read()
16
17
try:
- json.loads(filecontent)
18
+ jstyleson.loads(filecontent)
19
print(f"✅ JSON valid")
20
except Exception as err:
21
error = True
- print(f"❌ JSON invalid:")
22
+ print(f"❌ JSON invalid in {filename}:")
23
print(str(err))
24
25
if error:
0 commit comments