

It’s still very new and I suppose it is to be expected.
PYTHON BLACK FORMATTER LINE LENGTH CODE
Use it in your favourite CI tool to see your build fail if the code is not formatted as Blacks would.Ī last note: I have not experienced any issues myself with black but some of my colleagues did. If you really insist on having it NOT touch some sections of code, you can surround them with # fmt: off/on. Black took it to another level: there is almost not even any discussions possible at the configuration level.

One of the points for having a formatter is to make code uniform without having discussions around it. For this input:ĭata = īut that’s just me, and I get it. Personally, here is an example of formatting done by black that I dislike. If you are curious to learn why black formats the way it does, the readme contains a bunch of great rational explanations. There are in fact only two configurable formatting options: maximal line length and whether to normalize string quotes/prefixes or not. As the readme states it:īlack reformats entire files in place. Black is highly opinionated and has close to zero configuration. It will apply its style guide even where pep8 was not violated.
