/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
benchcompress / devel / check_format.sh
25 lines · 802 BCodeBlameHistory
4a53611pre-commitJeremy Magland 1#!/bin/bash
0602a7eui improvementsJeremy Magland 3# Get the directory where the script is located
4SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5PROJECT_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
4a53611pre-commitJeremy Magland 7# Check Python code formatting
8echo "Checking Python code formatting..."
0602a7eui improvementsJeremy Magland 9if ! black --check "$PROJECT_ROOT/zia_benchmark/src/zia_benchmark"; then
4a53611pre-commitJeremy Magland 10 echo "Python code is not properly formatted!"
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..."
0602a7eui improvementsJeremy Magland 17cd "$PROJECT_ROOT/web-ui"
4a53611pre-commitJeremy Magland 18if ! npm run format:check; then
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
24echo "All code is properly formatted!"
25exit 0
moveopenescclose