2024-04-18 15:32:38 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# bash strict mode
|
|
|
|
set -eup pipefail
|
|
|
|
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
2024-04-19 08:45:18 +02:00
|
|
|
EXCLUDED_DIRS=".vscode|great_expectations/resources"
|
2024-04-18 15:32:38 +02:00
|
|
|
echo "Validating JSON files..."
|
2024-04-19 08:45:18 +02:00
|
|
|
git ls-files | grep "\.json$" | grep -vE "/($EXCLUDED_DIRS)/" | while read file; do jq . "$file" >/dev/null 2>&1 || { echo "Invalid JSON in $file"; exit 1; }; done
|
2024-04-18 15:32:38 +02:00
|
|
|
echo "Validating YAML files..."
|
2024-04-19 08:45:18 +02:00
|
|
|
git ls-files | grep -E "\.ya?ml$" | grep -vE "/($EXCLUDED_DIRS)/" | while read file; do python ${SCRIPT_DIR}/validate_yaml.py "$file" >/dev/null 2>&1 || { echo "Invalid YAML in $file"; exit 1; }; done
|