Skip to content

Bardic v0.10.1: CLI tests and Bugfixes

Choose a tag to compare

@katelouie katelouie released this 02 May 21:35
· 1 commit to main since this release

Added

  • CLI test suite — 51 tests for CLI commands using Click's CliRunner:
    • bardic compile — 12 tests (basic compilation, custom output paths, metadata preservation, @include resolution, parent directory creation, error handling)
    • bardic lint — 13 tests (clean stories, W001/E002 diagnostics, compile-time vs lint-time error boundary, --json-output, --errors-only, --verbose flags, @include following, word count)
    • bardic init — 10 tests (all 4 templates: nicegui/web/browser/reflex, custom --path, error cases, file creation verification)
    • bardic graph — 8 CLI tests (PNG/SVG/PDF output, custom paths, passage/connection count reporting) + 8 extract_connections() unit tests (choice targets, jump targets, conditional branches, for-loops, text truncation, empty stories)
    • Total test count: 584 (up from 545)

Changed

Fixed

  • Format specifier parsing inconsistency — expression rendering and inline conditional branches used find(":") (leftmost colon) to split format specifiers, while the split_format_spec() utility used rfind(":") (rightmost). Both paths now use split_format_spec(), fixing potential issues with dict literals and slice notation containing colons.
  • Added detect_and_strip_indentation(code_lines) before joining the Python block into a string, allowing for indented @py blocks in scripts.