Skip to content

Commit

Permalink
Create validate_json.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartStake committed Feb 13, 2024
1 parent 05101f0 commit 3f3454e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/scripts/validate_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import json
import glob

def validate_json(json_file):
try:
json.load(open(json_file, 'r'))
print(f"Valid JSON: {json_file}")
except ValueError as e:
print(f"Invalid JSON: {json_file}")
print(f"Error: {e}")
exit(1)

if __name__ == "__main__":
print("starting json validation")
files = glob.glob('**/*.json', recursive=True)
for file in files:
validate_json(file)
print("after json validation")

0 comments on commit 3f3454e

Please sign in to comment.