Skip to content

refactor: extract watch-mode helpers, replace unicode, add tests#13

Merged
2 commits merged intomainfrom
refactor/watch-mode-and-test-coverage
Mar 28, 2026
Merged

refactor: extract watch-mode helpers, replace unicode, add tests#13
2 commits merged intomainfrom
refactor/watch-mode-and-test-coverage

Conversation

@noexecstack
Copy link
Copy Markdown
Owner

Summary

  • Extract _handle_key, _draw_header, _draw_content from the 271-line nested _run function in watch mode, reducing it to ~80 lines of orchestration
  • Replace reconnect_state mixed-type dict with a _ReconnectState dataclass
  • Replace all Unicode symbols (ellipsis, bullets, arrows, warning signs) with ASCII equivalents
  • Add 39 new tests covering _dump_yaml, _write_multi_doc_yaml, _find_unknown_flows, _print_unknown_warnings, _print_summary, _trunc, _print_report, _ReconnectState, _handle_key, and error paths for _parse_duration / _read_flows
  • Bump version to 0.7.2, update changelog

Test plan

  • ruff check passes
  • ruff format passes
  • mypy passes
  • All 120 tests pass (81 existing + 39 new)

- Use LOG.debug instead of logging.debug in _detect_hubble_cmd
- Replace assert with early-return guards in reader threads
- Guard cursor_flow_idx when ordered_keys is empty in watch mode
- Close capture file handle on early exit paths to prevent leak
- Add missing py.typed marker (referenced in CHANGELOG since v0.4.0)
- Add types-PyYAML to dev dependencies for local mypy
- Add .mypy_cache, .pytest_cache, .ruff_cache to .gitignore
- Bump version to 0.7.1, update changelog
…p 0.7.2

- Extract _handle_key, _draw_header, _draw_content from 271-line nested _run
- Replace reconnect_state dict with _ReconnectState dataclass
- Replace all Unicode symbols with ASCII equivalents in TUI and CLI output
- Add 39 new tests for output helpers, key handling, and error paths (120 total)
- Bump version to 0.7.2, update changelog
@noexecstack noexecstack closed this pull request by merging all changes into main in d0a8941 Mar 28, 2026
@noexecstack noexecstack deleted the refactor/watch-mode-and-test-coverage branch March 28, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant