Session 2
Let Aider lint and test as it goes
Goal. Get Aider to check its own work — automatically linting and testing code after each change.
▶ Try this prompt
Add a small test that checks the mean is calculated correctly, then run it.
Ask for tests as part of your request — Aider can automatically lint and test the code after each change and fix problems it finds.
- 1Ask Aider to add a check or a test alongside the feature. After it edits the code, Aider automatically lints and tests the result rather than leaving you to discover breakage later.
- 2When the lint or test surfaces an error, Aider reads the output and proposes a fix — then commits the corrected version, so the failing and fixed states are both in your Git history.
- 3Review the diff and the test result before moving on. The loop — edit, lint, test, commit — keeps each change verified instead of just plausible-looking.
You'll see. Aider editing the code, then running a lint and test pass and folding any fixes back in — all captured as Git commits.
Cost. Still only LLM token cost; the lint and test steps run locally on your machine and add nothing beyond the model calls Aider already makes.
Takeaway. Aider doesn't just write code — it lints and tests after each change, so what it commits is verified, not guessed.