Skip to content
Search

Black

lastmod 2025-06-19created 2020-12-138 edits

The uncompromising Python code formatter.

Exceptions

How to exclude code from formatting within the code:

  • Code between # fmt: off and # fmt: on. (at the same indentation level)
  • Or code in YAPF style.

Skip a single line:

  • # fmt: skip

See also

  • Python
  • Lint
  • YAPF
  • flake8
  • Ruff - A Python linter that is 10-100x faster
  • fixit - Meta releases Fixit 2, a next-generation auto-fixing linter for Python

Favorite site

author Zer0 sitemap