4SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5PROJECT_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
8echo "Checking Python code formatting..."
0602a7eui improvementsJeremy Magland 9if ! black --check "$PROJECT_ROOT/zia_benchmark/src/zia_benchmark"; then
11 echo "Please run './devel/format_code.sh' to format the code"
12 exit 1
13fi
15# Check TypeScript/JavaScript code formatting
16echo "Checking TypeScript/JavaScript code formatting..."
19 echo "TypeScript/JavaScript code is not properly formatted!"
20 echo "Please run './devel/format_code.sh' to format the code"
21 exit 1
22fi
25echo "Checking C++ code formatting..."
26cpp_files=$(find "$PROJECT_ROOT" -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" \))
27for file in $cpp_files; do
28 if ! clang-format --dry-run -Werror "$file" > /dev/null 2>&1; then
29 echo "C++ code is not properly formatted!"
30 echo "Please run './devel/format_code.sh' to format the code"
31 exit 1
32 fi
33done
36exit 0