{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/pre_rules_layers.py",
"offset": 75,
"limit": 30
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/tools\/ki-protokoll\/claude-hook\/quality\/pre_rules_layers.py",
"content": "\n if re.search(r\"DatabaseFactory::\", content):\n return block(\"H3\", \"DatabaseFactory only allowed in Factory classes\")\n\n return None\n\n\ndef h4_no_new_repository_in_controller(file_path: str, content: str) -> Optional[dict]:\n \"\"\"H4: Kein new Repository in Controller.\"\"\"\n if \"\/Controller\/\" not in file_path:\n return None\n if is_in_allowlist(file_path, GLOBAL_ALLOWLIST):\n return None\n\n if re.search(r\"new\\s+\\w+Repository\\s*\\(\", content):\n return block(\"H4\", \"new Repository in Controller not allowed. Use DI.\")\n\n return None\n\n\ndef h5_no_new_infrastructure_in_controller(file_path: str, content: str) -> Optional[dict]:\n \"\"\"H5: Kein new Infrastructure in Controller.\"\"\"\n if \"\/Controller\/\" not in file_path:\n return None\n if is_in_allowlist(file_path, GLOBAL_ALLOWLIST):\n return None\n\n if re.search(r\"new\\s+Infrastructure\\\\\", content):\n return block(\"H5\", \"new Infrastructure in Controller not allowed. Use DI.\")\n",
"numLines": 30,
"startLine": 75,
"totalLines": 123
}
}
}