Skip to content

refactor: Extract validation to utils module#27

Open
sofia-willow wants to merge 1 commit intoApexOpsStudio:mainfrom
sofia-willow:refactor/validation-utils
Open

refactor: Extract validation to utils module#27
sofia-willow wants to merge 1 commit intoApexOpsStudio:mainfrom
sofia-willow:refactor/validation-utils

Conversation

@sofia-willow
Copy link

Summary

Extracts scattered validation logic into a shared commands/utils.py module (#3).

What moved

Function From To
get_tasks_file() add.py, list.py, done.py (3 copies) commands/utils.py
validate_description() add.py commands/utils.py
validate_task_id() done.py commands/utils.py

Changes

  • New commands/utils.py with all shared functions and proper docstrings
  • commands/add.py — imports from utils, removed local copies
  • commands/list.py — imports from utils, removed local copies
  • commands/done.py — imports from utils, removed local copies
  • test_task.py — imports from commands.utils

No behavior changes. All existing functionality preserved.

Closes #3

Moved scattered validation and helper functions into a single
commands/utils.py module for better code organization.

Extracted to commands/utils.py:
- get_tasks_file() — was duplicated in add.py, list.py, done.py
- validate_description() — was in add.py
- validate_task_id() — was in done.py

All three command modules now import from commands.utils instead
of defining their own copies. Tests updated to import from utils.

Closes ApexOpsStudio#3
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.

Refactor: Extract validation to utils module

1 participant