code formatter

A tool that rewrites source code into a consistent layout, such as indentation and spacing, without changing what it does.

In more detail

Formatting removes noise from reviews by letting a tool, not a person, decide the layout, while linters and analyzers look for bugs. Run it automatically before commit or in continuous integration so formatting never comes up in review.

Examples

dotnet format --verify-no-changes
black file.py or ruff format . formats Python code; neither changes what it does.
black wordcount.py or ruff format . formats Python code.

Related terms

Taught in

References