⚠️ Status: Work In Progress - Rule implementation complete but test fails due to VM execution issues - Test shows empty diagnostics - possible VM crash during execution - User fixed Rust-layer newline bug (HEX encoding), but deeper VM issue remains ✅ Implementation: - tools/hako_check/rules/rule_brace_heuristics.hako: Complete implementation - Counts open/close braces (skips comments, handles string literals) - Reports mismatch with clear message format - tools/hako_check/tests/HC031_brace_heuristics/: Test files ready - ok.hako: Balanced braces (2 open, 2 close) - ng.hako: Unbalanced braces (2 open, 1 close) - should trigger warning - expected.json: Expected warning defined ❌ Known Issues: - VM execution fails before producing diagnostics JSON - Test output: {"diagnostics":[]} - Possible causes: Runtime error in rule code, VM memory issue - Requires deeper investigation of VM execution path 🎯 Next steps: - Debug VM execution with minimal HC031 test case - Check if issue is in _split_lines, _remove_strings, or main logic - Consider simplified version without string literal handling 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Hako Check — Rule Tests (MVP)
構成(1 ルール = 1 ディレクトリ)
- tools/hako_check/tests/<rule_name>/
- ok.hako … 検出なし
- ng.hako … 最低 1 件の検出
- edge.hako … 端境(任意)
- expected.json …
--format json-lspの期待ダイアグノスティクス
実行(MVP)
bash tools/hako_check/run_tests.shで全テストを走査- 差分があれば終了コード 1、詳細を提示
注意
- 21.4 は AST JSON 優先。Text fallback の差異は expected に反映
- ルール名は HCxxx を推奨(例: HC002)