{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "python3 -c \"\nfrom quality import post_rules, pre_rules\n\n# Test all imports work\nprint('=== Quality Gate Status ===')\nprint(f'Pre-Hook (BLOCK): {len(pre_rules.RULES)} rules')\nprint(f'Post-Hook (WARN): {len(post_rules.RULES)} rules')\nprint(f'Total: {len(pre_rules.RULES) + len(post_rules.RULES)} rules')\nprint()\n\n# Test a sample check\nresult = post_rules.check('\/test\/file.php', '''<?php\ntry {\n fopen('test.txt', 'r');\n} catch (Exception \\$e) {\n \/\/ empty\n}\n''')\nprint(f'Sample check warnings: {len(result[\\\"warnings\\\"])}')\nfor w in result['warnings'][:3]:\n print(f' - {w[:60]}...')\n\"",
"description": "Test quality gate integration"
}
}
{
"tool_response": {
"stdout": "=== Quality Gate Status ===\nPre-Hook (BLOCK): 31 rules\nPost-Hook (WARN): 50 rules\nTotal: 81 rules\n\nSample check warnings: 3\n - W8.4: Only generic Exception catch without specific handlers...\n - W9.1: try-block opens resources without finally. Use try-fin...\n - W9.6: fopen without matching close. Ensure resources are pro...",
"stderr": "",
"interrupted": false,
"isImage": false
}
}