pre-commit
3 changed files+26−4
.pre-commit-config.yamlmodified+3−3View file
@@ -1,8 +1,8 @@
11 repos:
22 - repo: local
33 hooks:
4- - id: format-code
5- name: Format Code
6- entry: devel/format_code.sh
4+ - id: check-format
5+ name: Check Code Formatting
6+ entry: devel/check_format.sh
77 language: script
88 pass_filenames: false
devel/check_format.shadded+21−0View file
@@ -0,0 +1,21 @@
1+#!/bin/bash
2+
3+# Check Python code formatting
4+echo "Checking Python code formatting..."
5+if ! black --check zia_benchmark/src/zia_benchmark; then
6+ echo "Python code is not properly formatted!"
7+ echo "Please run './devel/format_code.sh' to format the code"
8+ exit 1
9+fi
10+
11+# Check TypeScript/JavaScript code formatting
12+echo "Checking TypeScript/JavaScript code formatting..."
13+cd web-ui
14+if ! npm run format:check; then
15+ echo "TypeScript/JavaScript code is not properly formatted!"
16+ echo "Please run './devel/format_code.sh' to format the code"
17+ exit 1
18+fi
19+
20+echo "All code is properly formatted!"
21+exit 0
web-ui/package.jsonmodified+2−1View file
@@ -8,7 +8,8 @@
88 "build": "tsc -b && vite build",
99 "lint": "eslint .",
1010 "preview": "vite preview",
11- "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx}\""
11+ "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx}\"",
12+ "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx}\""
1213 },
1314 "dependencies": {
1415 "@tanstack/react-table": "^8.20.6",