refactor: extract validation and path utilities (fixes #3)#1
Open
refactor: extract validation and path utilities (fixes #3)#1
Conversation
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
Extracted scattered validation logic and duplicate path helpers into dedicated utility modules to improve code organization and reduce duplication.
Changes
commands/utils_validation.pywith centralized validation functions:validate_description()- validates task description length and contentvalidate_task_file()- validates tasks file existsvalidate_task_id()- validates task ID is in valid rangecommands/utils_paths.pywith path utilities:get_tasks_file()- centralized path to tasks.json (was duplicated in add.py, list.py, done.py)Benefits
get_tasks_file()implementationsTesting
Validation functions maintain identical behavior to original scattered implementations. All existing task operations continue to work as expected.
Payment
Bounty payment address (EVM/USDC on Base): 0xC50982e88dae25cf117a7eee7B489bc8a1FFD21a
Alternative (SOL): 9V75782FPZtTm4oS71ZeMU6Awv2WW3XuUr4dnLhgJ18P