Skip to content

refactor: extract validation and path logic to utils module#121

Open
pocikode wants to merge 1 commit into
ApexOpsStudio:mainfrom
pocikode:refactor/extract-validation-utils
Open

refactor: extract validation and path logic to utils module#121
pocikode wants to merge 1 commit into
ApexOpsStudio:mainfrom
pocikode:refactor/extract-validation-utils

Conversation

@pocikode

Copy link
Copy Markdown

Fixes #3

Extracted duplicated validation logic from the command files into two utility modules:

  • utils/paths.pyget_tasks_file() (was copy-pasted in all 3 command files)
  • utils/validation.pyvalidate_description(), validate_task_file(), validate_task_id()

The command files now import from utils. Same behavior, less duplication, easier to test.

Moved scattered validation logic from command files into:
- utils/paths.py: get_tasks_file()
- utils/validation.py: validate_description(), validate_task_file(), validate_task_id()

All command files (add, list, done) now import from utils instead of
defining their own validation functions. Reduces duplication and makes
validation logic easier to test and maintain.

Fixes ApexOpsStudio#3
@pocikode

Copy link
Copy Markdown
Author

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