Build out all 27 modules + capstone (#1)
Co-authored-by: claude <claude@jpaul.io> Co-committed-by: claude <claude@jpaul.io>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<!--
|
||||
Module 11 lab — the issue to file (the "contract" / station 1 of the loop).
|
||||
|
||||
Create a new issue on your git host. Paste the line below as the TITLE and everything under
|
||||
"Body" as the issue description. Note the number the host assigns it (e.g. #42) — every later
|
||||
step references it. Assign it to yourself for the first run-through.
|
||||
-->
|
||||
|
||||
Title: Add a `clear-done` command to remove completed tasks
|
||||
|
||||
Body:
|
||||
|
||||
**What**
|
||||
Add a `clear-done` command to the tasks CLI that removes every task already marked done, leaving
|
||||
the pending ones untouched.
|
||||
|
||||
**Why**
|
||||
After working through a list, the completed items pile up as noise. There's currently no way to
|
||||
clear them out short of editing `tasks.json` by hand.
|
||||
|
||||
**Acceptance criteria**
|
||||
- `python cli.py clear-done` removes all completed tasks and keeps all pending ones.
|
||||
- It prints how many tasks were removed.
|
||||
- The removal logic lives in `tasks.py` (a `TaskList` method), not in `cli.py`.
|
||||
- Running it when nothing is done is a no-op that removes 0 tasks (no crash).
|
||||
@@ -0,0 +1,28 @@
|
||||
<!--
|
||||
Module 11 lab — the pull request description (station 4 of the loop).
|
||||
|
||||
Paste this as the body when you open the PR from your branch into main. The "Closes" line is the
|
||||
load-bearing part: replace 42 with YOUR issue number. On merge to the default branch, the host
|
||||
closes that issue automatically and cross-links the two.
|
||||
|
||||
Closing keywords that work across the major hosts: Closes / Fixes / Resolves (and their
|
||||
variants). A bare "#42" links the issue but does NOT close it on merge.
|
||||
-->
|
||||
|
||||
## What this does
|
||||
|
||||
Adds a `clear-done` command that removes all completed tasks. The removal logic is a new `TaskList`
|
||||
method in `tasks.py`; `cli.py` just wires up the command and reports how many tasks were removed.
|
||||
|
||||
## How I tested it
|
||||
|
||||
- Added a mix of pending and done tasks, ran `clear-done`, confirmed only the done ones were removed
|
||||
and the count printed.
|
||||
- Ran `clear-done` with nothing marked done — removed 0, no crash.
|
||||
|
||||
## Review notes
|
||||
|
||||
Small two-file change. Check that the logic sits in `tasks.py` (not the CLI) and that the empty /
|
||||
nothing-done case is handled.
|
||||
|
||||
Closes #42
|
||||
Reference in New Issue
Block a user