Python library: Black

code formatter

Table of Contents

    21 Jul 2023

    pip install black

    What is Black?

    Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters.

    How does it work?

    Black makes code review faster by producing the smallest diffs possible. Blackened code looks the same regardless of the project you're reading. Formatting becomes transparent after a while and you can focus on the content instead.

    What does it do?

    Black reformats entire files in place. It is not a linter that warns you about formatting mistakes. It actually fixes them for you. Black makes code review faster by producing the smallest diffs possible.

    links

    social