Skip to content

Refactor: Extract validation to utils module#13

Open
Tianlin0725 wants to merge 2 commits intoApexOpsStudio:mainfrom
Tianlin0725:refactor/extract-validation-to-utils
Open

Refactor: Extract validation to utils module#13
Tianlin0725 wants to merge 2 commits intoApexOpsStudio:mainfrom
Tianlin0725:refactor/extract-validation-to-utils

Conversation

@Tianlin0725
Copy link

Summary

This PR extracts validation logic to a shared utils module as requested in issue #3.

Changes

  • Created utils/ directory with:

    • utils/__init__.py - Package exports
    • utils/validation.py - All validation functions (validate_description, validate_task_file, validate_task_id)
    • utils/paths.py - Shared path helpers (get_tasks_file)
  • Updated command files to use shared utilities:

    • commands/add.py
    • commands/list.py
    • commands/done.py

Verification

  • All existing tests pass (2/2)
  • No behavior changes - pure refactor
  • No duplicate validation code remains

/claim #3

Tianlin0725 and others added 2 commits February 23, 2026 10:13
- Added ensure_config_exists() function to create default config
- Config file is now auto-created at ~/.config/task-cli/config.yaml
- User sees helpful message instead of FileNotFoundError

Fixes ApexOpsStudio#2
- Create utils/validation.py with all validation functions
- Create utils/paths.py with shared path helpers
- Update commands to use shared utilities
- All existing tests pass (no behavior changes)

/claim 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.

1 participant