Skip to content

refactor: introduce ReedConfig dataclass and consolidate print_fn boi…#6

Merged
AzisK merged 1 commit intomainfrom
refactor/reed-config-and-print-fn
Feb 15, 2026
Merged

refactor: introduce ReedConfig dataclass and consolidate print_fn boi…#6
AzisK merged 1 commit intomainfrom
refactor/reed-config-and-print-fn

Conversation

@AzisK
Copy link
Owner

@AzisK AzisK commented Feb 15, 2026

…lerplate

  • Add frozen ReedConfig dataclass (model, speed, volume, silence, output) replacing argparse.Namespace in speak_text() core function
  • Convert argparse Namespace to ReedConfig at CLI boundary in main()
  • get_text() and _should_enter_interactive() keep argparse.Namespace (they use CLI-only fields: text, file, clipboard)
  • Remove 'if print_fn is None: print_fn = console.print' pattern from 7 functions; use console.print as default parameter value instead
  • Add _make_config() test helper for speak_text tests

…lerplate

- Add frozen ReedConfig dataclass (model, speed, volume, silence, output)
  replacing argparse.Namespace in speak_text() core function
- Convert argparse Namespace to ReedConfig at CLI boundary in main()
- get_text() and _should_enter_interactive() keep argparse.Namespace
  (they use CLI-only fields: text, file, clipboard)
- Remove 'if print_fn is None: print_fn = console.print' pattern from
  7 functions; use console.print as default parameter value instead
- Add _make_config() test helper for speak_text tests
- All 30 tests pass

Amp-Thread-ID: https://ampcode.com/threads/T-019c6133-6f61-7629-900a-216a4ac543a5
Co-authored-by: Amp <amp@ampcode.com>
@AzisK AzisK merged commit 444763b into main Feb 15, 2026
3 checks passed
@AzisK AzisK deleted the refactor/reed-config-and-print-fn branch February 15, 2026 16:57
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