Python Black for Emacs
Use the python
blackpackage to reformat your python buffers.
The whole buffer can be reformatted with
blacken-buffer. If you want to format every time you save, enable
blacken-modein relevant python buffers. Note that if
blacken-only-if-project-is-blackenedis non-nil, then blacken will only run if your
[tool.black]setting. This setting is off by default.
The following options change the behavior of black when reformatting buffers.
blacken-allow-py36Allow using Python 3.6-only syntax on all input files.
blacken-skip-string-normalizationDon't normalize string quotes or prefixes.
blacken-fast-unsafeSkips temporary sanity checks.
blacken-line-lengthMax line length enforced by blacken.
blacken.elis free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.