Cloud Parts

Linters

Rule engines that flag likely bugs, unused code and risky or outdated patterns, and fix many of them automatically.

How they work

A linter is a list of rules run over the syntax tree. Each rule looks for one pattern: an unused variable, a mutable default argument, a Printf whose arguments don’t match its format string. Rules are switched on by code or category, findings point to a file, line and column, and many rules carry a fix that --fix applies. Go’s vet is frank about the trade-off: its heuristics find real bugs the compiler misses, but not every report is a genuine problem.

Linters differ most in how they grow. ESLint lets anyone write custom rules and share them as plugins. Clippy groups its 800-plus Rust lints into categories with a default level each. Ruff re-implements Flake8, isort, pyupgrade and dozens of plugins natively in Rust, which makes it 10 to 100 times faster but means it has no custom rules.

The name comes from lint, a C checker Stephen C. Johnson wrote at Bell Labs in 1978 while porting Unix to a 32-bit machine. Like a clothes dryer’s lint trap, it was meant to catch the fluff and leave the fabric intact.

Technologies

What all linters, formatters and type checkers have in common →

Sources

Improve this page on GitHub