Black
A widely used Python code formatter that rewrites files into a single fixed style with almost no options.
In more detail
Running black . reformats every Python file under the current folder and reports which ones changed. Its output is stable, so formatting the same code twice changes nothing.
Related terms
- code formatter — A tool that rewrites source code into a consistent layout, such as indentation and spacing, without changing what it does.
- Ruff — A very fast Python linter and formatter: ruff check finds likely mistakes and ruff format lays out code in the Black style.
Taught in
- The Idle Editor And Running Programs — Hands-on Python: Complete Video Course & Book
- Dictionaries — Hands-on Python: Complete Video Course & Book
- Chapter One In One Sitting — Hands-on Python: Complete Video Course & Book
- A Graphics Introduction — Hands-on Python: Complete Video Course & Book
- Formatting, Linting And Style — Hands-on Python: Complete Video Course & Book