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
| Tool | Catches | Cost |
|---|---|---|
| Formatter | style, entirely | none, it is automatic |
| Linter | likely mistakes, bad patterns | some configuration |
| Type checker | whole categories of bug | adoption effort |
| Static analysis | security issues, complexity | some false positives |
| Dependency scanner | known vulnerabilities | noise 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
if (user = null) { } // assignment, not comparison
const items = [];
items = getItems(); // assigning to a const
await Promise.all(items); // items is not promisesEach 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
editor instant, while typing
pre-commit before it enters history
CI the one that actually blocksAll 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.