Skip to content

Commit

Permalink
TRCL-2832: Add script to validate JSON files (#92)
Browse files Browse the repository at this point in the history
* Add script to validate JSON files

* Test failure cases

* Revert "Test failure cases"

This reverts commit 8251a85.
  • Loading branch information
ruixhuang authored Oct 6, 2023
1 parent 1f127a3 commit 761d5f3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/ci_validate_json_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

json_files=$(find . -name "*.json")

# Validate JSON files
for file in $json_files
do
echo "Validating $file"
result=`python -m json.tool $file`
if [ $? -ne 0 ]; then
echo "Invalid JSON file: $file"
exit 1
fi
done

0 comments on commit 761d5f3

Please sign in to comment.