Skip to content

Black and flake8 no longer in sync #4173

@daveah

Description

@daveah

Describe the bug

Empty classes now format differently between black and what flake8 expects:

To Reproduce

class Foo:
    ...

Reformats with the latest black to:

class Foo: ...

Which then flails flake8 with:

E701 multiple statements on one line (colon)

Expected behavior

Flake8 and black should be compatible in accordance with guidance at: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8

Environment

  • Black's version: 24.1.0
  • OS and Python version: Python 3.10.13
  • flake8 --version: 6.1.0 (mccabe: 0.7.0, pycodestyle: 2.11.1, pyflakes: 3.1.0) CPython 3.10.13 on Linux

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions