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-changesblack file.py or ruff format . formats Python code; neither changes what it does.black wordcount.py or ruff format . formats Python code.Related terms
- dotnet format — The dotnet command that applies the repository's EditorConfig style and analyzer fixes to code.
- linter — A tool that reads code or configuration without running it and flags likely mistakes and style problems.
- EditorConfig — A plain-text .editorconfig file that records a repository's coding style, and in .NET also the severity of each analyzer rule, for editors and the build to apply.
- Black — A widely used Python code formatter that rewrites files into a single fixed style with almost no options.
- Ruff — A very fast Python linter and formatter: ruff check finds likely mistakes and ruff format lays out code in the Black style.
- PEP 8 — The official style guide for Python code, covering layout, naming and common idioms.
- quality gate — A check, or set of checks, that a change must pass before it can move on, such as being merged or promoted to the next pipeline stage.
Taught in
- Code Quality: .editorconfig and Roslyn Analyzers — Modern .NET Core, C# & Enterprise Microservices
- HTML Forms And Dynamic Programs — Hands-on Python: Complete Video Course & Book
- Formatting, Linting And Style — Hands-on Python: Complete Video Course & Book
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book
- What To Automate Away — Automated Testing, TDD & Quality Engineering