32dots HEIDELBERG AI
Session 2 medium

Let Aider lint and test as it goes

LESSONLesson 2 · ~20 min

🎯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.

  1. 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.
  2. 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.
  3. 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.