Files
2026-10-18 12:00:06 +02:00

26 lines
920 B
JSON

{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "file=$(cat | python3 -c 'import json,sys; print(json.load(sys.stdin).get(\"tool_input\",{}).get(\"file_path\",\"\"))'); case \"$file\" in *.py) python3 -m py_compile \"$file\" ;; *.ts|*.vue|*.js) if [ -d \"$(dirname \"$file\")/../node_modules\" ] || [ -d frontend/node_modules ]; then (cd frontend && npx --no-install eslint --fix \"${file#frontend/}\" 2>&1 || true); fi ;; esac"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "set -e; python3 -m compileall backend -q; if [ -d frontend/node_modules ]; then (cd frontend && npm run build); else echo 'frontend/node_modules missing, skipping frontend build check'; fi"
}
]
}
]
}
}