Fix broken git demos/labs in Modules 4, 7, 14 (#2,#3,#4,#12) (#55)

Co-authored-by: claude <claude@jpaul.io>
Co-committed-by: claude <claude@jpaul.io>
This commit was merged in pull request #55.
This commit is contained in:
2026-06-22 14:52:31 -04:00
committed by Claude (agent)
parent b061a9da14
commit e2a53c8259
3 changed files with 98 additions and 39 deletions
+10 -4
View File
@@ -274,15 +274,21 @@ and watch CI stop it.
`test_pending_excludes_completed_tasks` failed, with the assertion and the actual-vs-expected
values. CI caught in seconds what a skim would have waved through.
9. Reproduce and fix:
9. Reproduce and fix. The bad change is already committed *and pushed*, so `git restore` is no help
here — it only discards *uncommitted* edits, and there are none. The team-safe undo for something
already on shared history is `git revert` (Module 12): it writes a **new** commit that inverts the
bad one, instead of rewriting history other people may have pulled.
```bash
pytest -q # fails locally too — same command, same failure
git restore tasks.py # throw away the bad change (Module 2's safety net)
git commit -am "Revert: pending() must exclude completed tasks"
git push # CI goes green again
git revert HEAD # new commit that undoes "Simplify pending()" (Module 12)
git push # CI re-runs on the fixed code and goes green again
```
`git revert HEAD` opens an editor with a prefilled message (`Revert "Simplify pending()"`) — save
and close it. The revert restores the correct `pending()`, the push triggers CI on the fixed code,
and the run goes green.
10. *(Optional, to feel the linter tier.)* Add an obviously unused import to `cli.py`
(`import os` at the top, unused), commit, and push. Watch the **Lint** step fail *before* the
tests even run — the cheap check failing fast. Remove it and push again.