Skip to content

step 7 / 32 · 5 min

Letting machines do the boring review

A reviewer who spends their attention on formatting has none left for whether the code is correct. Tools take the mechanical half.

The layers

ToolCatchesCost
Formatterstyle, entirelynone, it is automatic
Linterlikely mistakes, bad patternssome configuration
Type checkerwhole categories of bugadoption effort
Static analysissecurity issues, complexitysome false positives
Dependency scannerknown vulnerabilitiesnoise if unmaintained

Formatters end the argument

Prettier, Black, gofmt, rustfmt. They reformat the file with no options worth arguing about, and the benefit is not beauty: it is that style stops being a topic.

Run it on save and in the pipeline. A repository where formatting is enforced never has a review comment about a brace again.

Linters find real bugs

javascript
if (user = null) { }        // assignment, not comparison
const items = [];
items = getItems();         // assigning to a const
await Promise.all(items);   // items is not promises

Each is a bug a reader might miss and a linter reports instantly. Configure it once, fail the build on errors, and treat warnings as a backlog rather than noise to ignore.

Types

Static typing catches an entire class of error before the code runs, and the value goes up with the size of the codebase and the team.

TypeScript over JavaScript, type hints plus mypy in Python, and the compiler in Java, Go, Rust and C#. The argument for adopting them in a dynamic language is strongest in exactly the place people resist it: a large codebase several people touch.

Where to run them

code
editor       instant, while typing
pre-commit   before it enters history
CI           the one that actually blocks

All three, and the pipeline is the one that counts, because the others can be skipped.

The failure mode

A pipeline reporting 400 warnings teaches everyone to ignore warnings, which means the one real problem is invisible.

Fix it by fixing them, or by turning off the rules you do not intend to follow. A short list of rules that are enforced beats a long list that is ignored, and this is the same lesson as the red build: a signal nobody acts on is not a signal.