Skip to content

Implement task tracker CLI with JSON persistence and tests#1

Open
Rahulthespy wants to merge 1 commit into
masterfrom
codex/develop-complete-code-solution
Open

Implement task tracker CLI with JSON persistence and tests#1
Rahulthespy wants to merge 1 commit into
masterfrom
codex/develop-complete-code-solution

Conversation

@Rahulthespy

Copy link
Copy Markdown
Owner

Motivation

  • Provide a minimal, complete, and runnable CLI-based task tracker with persistent JSON storage so tasks can be added, listed, completed, and deleted from the command line.
  • Ship a packaged project layout and automated tests to make the project easy to run and verify with pytest.

Description

  • Added src/tracker.py implementing a Task dataclass and TaskTracker with JSON load/save, add_task, list_tasks, complete_task, and delete_task behavior and validation.
  • Added src/main.py CLI entrypoint using argparse with add, list, done, and delete subcommands and a configurable --db path, and wired a console script labtracker in pyproject.toml.
  • Added pyproject.toml with project metadata, labtracker entry point, and pytest configuration, and added .gitignore for Python artifacts.
  • Added unit tests in tests/test_tracker.py covering add/list, complete/delete, invalid task id, and blank-title validation, and updated README.md with quickstart and usage examples.

Testing

  • Ran python -m pytest -q which executed the test suite.
  • All tests passed: 4 passed (covers add/list, complete/delete, invalid id, and blank title cases).

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/main.py
status = "✅" if task.done else "⬜"
print(f"{status} [{task.id}] {task.title}")
elif args.command == "done":
task = tracker.complete_task(args.id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant