TECHNOLOGY

Aider lint commands receive filenames and must distinguish formatting from failure

In this article
THE QUICK TAKE

A lint command must accept the file scope Aider supplies and report unresolved errors accurately; formatter changes and test failures are different signals.

Treat linting as a command interface

A project replaces its default checks with a preferred linter, but Aider starts diagnosing command-line errors as code defects. The integration contract matters: the linter must accept the filenames Aider supplies and expose genuine failures through its output and exit status. Test that small interface independently before allowing its messages to drive repeated model edits.

Accept the intended file arguments

The testing and linting guide says custom lint commands receive filenames and should report errors on standard output or error with a nonzero exit. This differs from the test-command path, which does not append filenames. A script designed to run a complete project test suite may interpret appended paths incorrectly. Decide whether the check belongs in the lint or test role according to its actual invocation needs.

Make formatting outcomes unambiguous

Some formatters return a nonzero status after modifying files even when no unresolved defect remains. The guide warns that this can look like a lint error to Aider. Use a wrapper or check mode with meaningful final status for the chosen formatter, and inspect the resulting file changes. Do not suppress every nonzero outcome merely to quiet the assistant: that also hides genuine syntax or rule failures the repair loop should receive.

Read configuration and manual scope separately

The options reference documents language-qualified --lint-cmd values and automatic linting enabled by default. Automatic testing is a separate setting. The command reference says manual /lint works on in-chat files, or dirty files if none are present. A manual check can consequently have a different file scope from the last edited file. Record the effective selection before attributing an unrelated existing violation to the new patch.

Review what the feedback caused

Use a small formatting change and a real lint error to verify that they produce the intended distinct outcomes. Inspect diagnostics, assistant repairs, and the final diff together. The task-contract guide keeps the requested change visible; tool observations distinguish command status from repaired behavior. Once the interface is correct, evaluate the actual code change instead of repeatedly broadening the lint scope to obtain a reassuring green result.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles