-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate.sh
More file actions
executable file
·61 lines (52 loc) · 1.53 KB
/
Copy pathvalidate.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Validation script for Smart Fan Controller custom component
set -e
echo "🔍 Validating Smart Fan Controller custom component..."
# Check if custom_components directory exists
if [ ! -d "custom_components/smart_fan_controller" ]; then
echo "❌ Error: custom_components/smart_fan_controller directory not found"
exit 1
fi
echo "✅ Directory structure OK"
# Validate Python syntax
echo "🐍 Checking Python syntax..."
python_files=$(find custom_components/smart_fan_controller -name "*.py")
for file in $python_files; do
if python -m py_compile "$file"; then
echo " ✅ $file"
else
echo " ❌ $file"
exit 1
fi
done
# Validate JSON files
echo "📋 Checking JSON files..."
json_files=$(find custom_components/smart_fan_controller -name "*.json")
for file in $json_files; do
if python -m json.tool "$file" > /dev/null; then
echo " ✅ $file"
else
echo " ❌ $file"
exit 1
fi
done
# Check required files
echo "📁 Checking required files..."
required_files=(
"custom_components/smart_fan_controller/__init__.py"
"custom_components/smart_fan_controller/manifest.json"
"custom_components/smart_fan_controller/config_flow.py"
"custom_components/smart_fan_controller/const.py"
"README.md"
)
for file in "${required_files[@]}"; do
if [ -f "$file" ]; then
echo " ✅ $file"
else
echo " ❌ $file missing"
exit 1
fi
done
echo ""
echo "✅ All validations passed!"
echo "🚀 Component is ready for testing"