✅ Enhancement: - tools/hako_check/run_tests.sh: Added argument handling (lines 97-116) - Previously: Always ran all tests regardless of arguments - Now: Can run specific test directory when provided as argument - Example: bash run_tests.sh tools/hako_check/tests/HC021_analyzer_io_safety ✅ Use cases: - Faster iteration during rule development - Targeted debugging of specific rule tests - CI/CD pipeline optimization 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Hako Check — Diagnostics Contract (MVP)
This tool lints .hako sources and emits diagnostics.
Diagnostics schema (typed)
- Map fields:
rule: string like "HC011"message: string (human-readable, one line)file: string (path)line: int (1-based)severity: string ("error"|"warning"|"info"), optional (default: warning)quickFix: string, optional
Backwards compatibility
- Rules may still
out.push("[HCxxx] ...")with a single-line string. - The CLI accepts both forms. String diagnostics are converted to typed internally.
Suppression policy
- HC012 (dead static box) takes precedence over HC011 (unreachable method).
- If a box is reported by HC012, HC011 diagnostics for methods in that box are suppressed at aggregation.
Quiet / JSON output
- When
--format json-lspis used, output is pure JSON (pretty). Combine withNYASH_JSON_ONLY=1in the runner to avoid extra lines. - Non-JSON formats print human-readable lines per finding.
Planned AST metadata (parser_core.hako)
boxes[].span_line: starting line of thestatic boxdeclaration.methods[].arity: parameter count as an integer.boxes[].is_static: boolean.
Notes
- Prefer AST intake; text scans are a minimal fallback.
- For tests, use
tools/hako_check/run_tests.sh.