/lint
Lints and fixes the files in the chat, or all dirty files if none are in the chat.
/lint checks the files currently in the chat with the configured linter (built in per language, or set via --lint-cmd) and has Aider fix any issues found. If no files are in the chat, all files with uncommitted changes (dirty files) get linted instead. The docs note Aider already auto-lints every file it edits itself by default.
โ WHEN TO USE IT?
Check manually changed files before continuing
/lint โ after changing code yourself outside Aider, to check and fix the dirty files
Lint specific files in the chat on demand
/add payment.py followed by /lint, to check just that file
โ WHEN NOT TO?
Wanting to check tests instead of lint errors
/lint only checks with the linter, not a test suite.
Better: Use /test <test-command> to run tests and have failures fixed
Expecting to have to manually trigger linting after every Aider change
The docs say Aider already auto-lints every file it edits by default; /lint is for the extra, manual case.
Better: Only set --no-auto-lint if automatic linting should be explicitly turned off
SOURCES
- Aider Docs โ In-chat commands โ aider.chat
- Aider Docs โ Linting and testing โ aider.chat