refactor: extract validation and path utilities to utils module (closes #3)#34
Open
DrGalio wants to merge 1 commit intoApexOpsStudio:mainfrom
Open
refactor: extract validation and path utilities to utils module (closes #3)#34DrGalio wants to merge 1 commit intoApexOpsStudio:mainfrom
DrGalio wants to merge 1 commit intoApexOpsStudio:mainfrom
Conversation
- Create utils/ directory with __init__.py - Create utils/validation.py with validate_description, validate_task_id, validate_task_file - Create utils/paths.py with get_config_path, get_tasks_file - Update commands/add.py to import from utils - Update commands/done.py to import from utils - Update commands/list.py to import from utils - Update test_task.py to import from utils - Update task.py to use get_config_path from utils - Add .gitignore for __pycache__ and .pytest_cache No behavior changes - all existing tests pass. Closes ApexOpsStudio#3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts all input validation logic and shared path helpers into a dedicated
utils/module, eliminating code duplication across command files.Changes
utils/__init__.py: New module packageutils/paths.py: Shared path helpers (get_config_path,get_tasks_file)utils/validation.py: All validation functions (validate_description,validate_task_id,validate_task_file)commands/add.py: Now importsvalidate_descriptionfrom utilscommands/done.py: Now importsvalidate_task_idfrom utilscommands/list.py: Now importsvalidate_task_filefrom utilstask.py: Usesget_config_pathfrom utilstest_task.py: Updated imports to use utils.gitignore: Added for pycache and .pytest_cacheTesting
All existing tests pass:
CLI functionality verified:
Acceptance Criteria
utils/validation.pyutils/paths.pyCloses #3