Part 03 / Topic 5 of 6
Linting, formatting and type checks
Style arguments waste review time, and at a customer, review time is scarce and visible. Automate style so reviews focus on logic:
- A formatter (black, or ruff's formatter) ends every discussion about layout.
- A linter (ruff) catches unused imports, shadowed names, obvious bugs.
- A type checker (mypy or pyright) turns the hints from Part 2 into checked claims —
weight_kg: float | Nonenow fails the build when someone forgets theNonebranch.
Run all three locally and in CI. The tools themselves matter less than the fact that they run on every push, mechanically — a human should never be the linter.
Done here? The practice set for Part 3 — 4 exercises with solutions — is on the part page.