Implement task tracker CLI with JSON persistence and tests#1
Implement task tracker CLI with JSON persistence and tests#1Rahulthespy wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea70487037
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| status = "✅" if task.done else "⬜" | ||
| print(f"{status} [{task.id}] {task.title}") | ||
| elif args.command == "done": | ||
| task = tracker.complete_task(args.id) |
There was a problem hiding this comment.
Catch TaskTracker validation errors in CLI
TaskTracker raises ValueError for normal user mistakes (e.g., unknown task IDs or blank titles), but this call path is not wrapped in error handling, so common input errors print full Python tracebacks and look like crashes. For example, done on a non-existent ID currently exits with a stack trace instead of a clean CLI error; this should be handled in main() with a user-facing message and non-zero exit.
Useful? React with 👍 / 👎.
Motivation
pytest.Description
src/tracker.pyimplementing aTaskdataclass andTaskTrackerwith JSONload/save,add_task,list_tasks,complete_task, anddelete_taskbehavior and validation.src/main.pyCLI entrypoint usingargparsewithadd,list,done, anddeletesubcommands and a configurable--dbpath, and wired a console scriptlabtrackerinpyproject.toml.pyproject.tomlwith project metadata,labtrackerentry point, and pytest configuration, and added.gitignorefor Python artifacts.tests/test_tracker.pycovering add/list, complete/delete, invalid task id, and blank-title validation, and updatedREADME.mdwith quickstart and usage examples.Testing
python -m pytest -qwhich executed the test suite.4 passed(covers add/list, complete/delete, invalid id, and blank title cases).Codex Task