[loop-generated] [refactor] Break up cli.py::daily_run() — 105 lines #1168

Closed
opened 2026-03-23 20:30:58 +00:00 by Timmy · 2 comments
Owner

Problem

src/timmyctl/cli.py::daily_run() is 105 lines — too long for a single function.

Acceptance Criteria

  • Extract logical sections into helper functions
  • Keep daily_run() under 40 lines as an orchestrator
  • All existing tests pass (tox -e unit)

Files

  • src/timmyctl/cli.py
## Problem `src/timmyctl/cli.py::daily_run()` is 105 lines — too long for a single function. ## Acceptance Criteria - Extract logical sections into helper functions - Keep `daily_run()` under 40 lines as an orchestrator - All existing tests pass (`tox -e unit`) ## Files - `src/timmyctl/cli.py`
Author
Owner

Kimi, break up src/timmyctl/cli.py::daily_run() (105 lines).

Steps:

  1. Read the function, identify 3-4 logical sections
  2. Extract each section into a private helper function in the same file
  3. Have daily_run() call the helpers — it should be under 40 lines
  4. Run tox -e unit to verify nothing breaks
  5. Branch: kimi/issue-1168, commit: refactor: break up cli.py::daily_run() (#1168)
Kimi, break up `src/timmyctl/cli.py::daily_run()` (105 lines). Steps: 1. Read the function, identify 3-4 logical sections 2. Extract each section into a private helper function in the same file 3. Have `daily_run()` call the helpers — it should be under 40 lines 4. Run `tox -e unit` to verify nothing breaks 5. Branch: `kimi/issue-1168`, commit: `refactor: break up cli.py::daily_run() (#1168)`
kimi was assigned by Timmy 2026-03-23 20:31:41 +00:00
Collaborator

PR created: #1189

Refactored cli.py::daily_run() from 105 lines to 33 lines by extracting 5 helper functions:

  • _load_daily_run_config() - Load and validate config
  • _display_schedules_table(schedules) - Display schedules table
  • _display_triggers_table(triggers) - Display triggers table
  • _execute_automation(auto, verbose) - Execute single automation
  • _execute_all_automations(verbose) - Execute all enabled automations

All 293 unit tests pass. Format and lint clean.

**PR created:** #1189 Refactored `cli.py::daily_run()` from 105 lines to 33 lines by extracting 5 helper functions: - `_load_daily_run_config()` - Load and validate config - `_display_schedules_table(schedules)` - Display schedules table - `_display_triggers_table(triggers)` - Display triggers table - `_execute_automation(auto, verbose)` - Execute single automation - `_execute_all_automations(verbose)` - Execute all enabled automations All 293 unit tests pass. Format and lint clean. ✅
kimi closed this issue 2026-03-23 21:51:48 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1168