🌐
GitHub
github.com › psf › black
GitHub - psf/black: The uncompromising Python code formatter · GitHub
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.
Starred by 41.4K users
Forked by 2.7K users
Languages   Python
🌐
PyPI
pypi.org › project › black
black · PyPI
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.
      » pip install black
    
Published   Mar 12, 2026
Version   26.3.1
Discussions

Adding black as linter?
I thoroughly enjoy working on projects where we never, ever have to debate style in PRs. A very effective way to achieve that is to use a formatter, such as black. Now, I know that black is somewhat controversial (because the code it produces isn’t always what we would have written). More on discuss.scientific-python.org
🌐 discuss.scientific-python.org
0
7
October 5, 2022
Is the damage psf/Black has done to the community reversible?
capable narrow wistful simplistic bells historical bright possessive disagreeable birds This post was mass deleted and anonymized with Redact More on reddit.com
🌐 r/Python
133
0
July 26, 2024
formatter - Doubts about black formatting in python - Stack Overflow
I'm configurating Visual Studio Code or Python programming, using PyLint as linter and Black as a formatter. I could configure for auto-formating when save but i was wondering if there is a way to ... More on stackoverflow.com
🌐 stackoverflow.com
Which code formatter do you use?
Black. We don't care that it may look bad. We don't want to argue about formatting. We know it isn't configurable, that's the point. We don't want to deal with everyone's configuration preferences. More on reddit.com
🌐 r/Python
144
68
December 21, 2022
🌐
Black
black.readthedocs.io
Black 26.3.0 documentation
By using Black, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting.
🌐
DEV Community
dev.to › saminarp › write-clean-python-code-using-pylint-and-black-17e3
✨Write clean Python code using pylint and black ✨🐍 - DEV Community
November 5, 2022 - Search for 'python formatting provider' and then select 'black' from the drop down menu: After that search for 'format on save' and enable the "Editor: Format On Save" option · Now, everytime you save, the code will be automatically formatted.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Black Formatter - Visual Studio Marketplace
Extension for Visual Studio Code - Formatting support for Python files using the Black formatter.
🌐
Adafruit
learn.adafruit.com › improve-your-code-with-pylint › black
Black | Improve Your Code with Pylint and Black | Adafruit Learning System
August 23, 2019 - When you submit your code to the CircuitPython project, it's checked for syntax. You submit a pull request with your code and wait to see if the checks pass. Wouldn't it be nice to check your code BEFORE you submit it? You can! This guide will walk you through the steps to get Pylint and Black set up locally so you can lint your own code like a pro.
🌐
Read the Docs
black.readthedocs.io › en › stable › the_black_code_style › current_style.html
The Black code style - Black 26.3.0 documentation
Black prefers parentheses over backslashes, and will remove backslashes if found. # in: if some_short_rule1 \ and some_short_rule2: ... # out: if some_short_rule1 and some_short_rule2: ... # in: if some_long_rule1 \ and some_long_rule2: ... # out: if ( some_long_rule1 and some_long_rule2 ): ... Backslashes and multiline strings are one of the two places in the Python grammar that break significant indentation.
🌐
Vercel
black.vercel.app
Black Playground
Playground for Black, the uncompromising Python code formatter.
Find elsewhere
🌐
Scientific Python
discuss.scientific-python.org › contributor & development discussion › scikit-image
Adding black as linter? - scikit-image - Scientific Python
October 5, 2022 - I thoroughly enjoy working on projects where we never, ever have to debate style in PRs. A very effective way to achieve that is to use a formatter, such as black. Now, I know that black is somewhat controversial (becau…
🌐
Luminous Men
luminousmen.com › post › my-unpopular-opinion-about-black-code-formatter
My unpopular opinion about black code formatter
February 11, 2020 - But Black is not about this at all, Black removes visual cues, as it is written in the documentation 'It doesn't take previous formatting into account. It doesn't care about best practices and readable code. It's just formatting. That's it. On this basis, I prefer to use a strict linter than an autoformatting tool no matter how good it is.
🌐
Reddit
reddit.com › r/python › is the damage psf/black has done to the community reversible?
r/Python on Reddit: Is the damage psf/Black has done to the community reversible?
July 26, 2024 -

I really don't understand why the Python Black formatter seems to be so popular. What is the point of a non-configurable and highly biased code formatter? I see no benefit in making all the code in the world look the same. They claim they are ending discussions about code formatting, but in reality they have sparked the biggest debate ever in the Python community with their subjective and often contradictory methods that have evolved over decades of established practices without the ability to configure the formatter. [1][2] The single/double quote disaster is just the most prominent example.

There are people out there who put readability above consistency with every other code base in the world that they will never come into contact with.

What bothers me most is the detachment of the Black developers, who dismiss all objections to their style choices as if they were opinions, and end every discussion by saying, you are just expressing an opinion and we prefer ours. But that is not true, there were many reasons, objectively measurable reasons, why this or that decision is better. Someone else might weigh these reasons differently and therefore come to a different conclusion. But the arguments used to enforce Black's decisions have never stood the test of time in a factual discussion.

I also notice that younger developers (< 35 years) are more likely to accept this approach than the more experienced ones.

[1] https://github.com/psf/black/issues/1252

[2] https://github.com/psf/black/issues/373

🌐
GitHub
github.com › astral-sh › ruff
GitHub - astral-sh/ruff: An extremely fast Python linter and code formatter, written in Rust. · GitHub
2 weeks ago - # Exclude a variety of commonly ignored directories. exclude = [ ".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg", ".ipynb_checkpoints", ".mypy_cache", ".nox", ".pants.d", ".pyenv", ".pytest_cache", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", ".vscode", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "site-packages", "venv", ] # Same as Black. line-length = 88 indent-width = 4 # Assume Python 3.10 target-version = "py310" [lint] # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
Starred by 46.7K users
Forked by 2K users
Languages   Rust 96.3% | Python 2.7% | TypeScript 0.9% | Shell 0.1% | CSS 0.0% | HTML 0.0%
🌐
Medium
medium.com › @evaGachirwa › improving-python-code-quality-using-pylint-and-black-5094dbebc1b2
Improving python code quality using Pylint and Black | by Eva Mwangi | Medium
May 28, 2022 - Use black before pylint, you will love it!! Pylint is a bug and code quality checker in python. It acts as a bad reviewer who nitpicks your code, checking where you used + to concatenate strings instead of using fstrings. While it could be that simple it also suggests how a programmer handles errors, how they use try-catch operations etc.
🌐
freeCodeCamp
freecodecamp.org › news › auto-format-your-python-code-with-black
How to Auto-Format Your Python Code with Black
May 12, 2020 - You can use black sample_code.py in the terminal to change the format. After running Black, you will see the following output: Then you can open sample_code.py to see formatted python code:
🌐
Astral
astral.sh › blog › the-ruff-formatter
The Ruff Formatter: An extremely fast, Black-compatible Python formatter
October 24, 2023 - It’s over 30x faster than Black and 100x faster than YAPF, formatting large-scale Python projects in milliseconds — all while achieving >99.9% Black compatibility. A little over a year ago, I made the first commit to Ruff, an extremely fast Python linter, written in Rust.
🌐
MegaLinter
megalinter.io › 7 › descriptors › python_black
black configuration in MegaLinter - MegaLinter by OX Security
This linter is available in the following flavours ... Usage: black [OPTIONS] SRC ... The uncompromising code formatter. Options: -c, --code TEXT Format the code passed in as a string. -l, --line-length INTEGER How many characters per line to allow. [default: 88] -t, --target-version [py33|py34|py35|py36|py37|py38|py39|py310|py311|py312|py313] Python versions that should be supported by Black's output.
🌐
Medium
manishankarjaiswal.medium.com › formatting-and-linting-python-code-with-isort-black-and-flake8-39bf876666ed
Formatting and Linting Python Code with isort, black, and flake8 | by Manishankar Jaiswal | Medium
January 15, 2025 - black is an uncompromising code formatter for Python. Its goal is to standardize formatting, eliminating debates over style choices. Opinionated and consistent: Adheres to PEP 8 by default.
🌐
Stack Overflow
stackoverflow.com › questions › 73927074 › doubts-about-black-formatting-in-python
formatter - Doubts about black formatting in python - Stack Overflow
I could configure for auto-formating when save but i was wondering if there is a way to "tell" black to use the variable name convention for PEP8... for example, if detects a constant to change automatically to upper case, if it's a variable that is in camel case that converts it to snake_case, etc.. ... { "python.linting.pycodestyleEnabled": true, "python.linting.pycodestyleArgs": [ "--max-line-length=90" ], "python.linting.pylintEnabled": true, "python.formatting.provider": "black", "[python]":{ "editor.formatOnSabe":true, }, "python.linting.enabled": true,
🌐
Packetcoders
packetcoders.io › whats-the-difference-black-vs-ruff
Black vs Ruff - What's the difference?
November 2, 2023 - Provides formatting features for a drop-in replacement for Black. Provides linting features for a drop-in replacement for flake8 (and its various plugins), isort, bandit. Therefore, the clear destination between the two tools is Ruff's speed and also Ruff's functionality to replace the various linting and formatting tools used within a Python project.
🌐
DEV Community
dev.to › ldsands › the-best-linter-for-black-in-vs-code-54a0
The Best Linter for Black in VS Code - DEV Community
March 24, 2020 - However, when I format the document using Black, many little errors will come up. After tracking down the configurations need to ignore this issue, I entered them into VS Code so I don't have this issue anymore. You can change the settings through the Settings tab if you prefer, but I will not cover those instructions here. To enter the settings.json file press ctrl+, then select the open settings (JSON) icon in the upper right hand corner. Then enter the following into the file: "python.linting.enabled": true, "python.linting.flake8Enabled": true, "python.linting.flake8Args": [ "--ignore=E203", "--ignore=E266", "--ignore=E501", "--ignore=W503", "--max-line-length=88", "--select = B,C,E,F,W,T4,B9", "--max-complexity = 18" ],