PyCQA / pycodestyle

Simple Python style checker in one Python file
https://pycodestyle.pycqa.org
Other
5.01k stars 755 forks source link

flake8 E704 Errors Triggered by Inline Ellipsis Formatting in Newer black Versions #1926 #1235

Closed camilamacedo86 closed 5 months ago

camilamacedo86 commented 5 months ago

what I expected to happen

I expected that updating to newer versions of black would maintain compatibility with flake8 by avoiding the E704: multiple statements on one line (def) error, consistent with the behavior observed in previous versions.

PS: Earlier versions of black (e.g., 22.6.0) formatted the ellipsis (...) on the next line, thereby avoiding the E704 error in flake8.

Example

Before Update (black==22.6.0) In the previous version of black, the formatter would automatically place the ellipsis (...) on a separate line when formatting functions or methods, like so:

def example_function(arg1: int, arg2: str) -> None:

After Update (black==24.3.0) With the update to black version 24.3.0, the formatting behavior changed. Now, the ellipsis is placed on the same line as the function or method declaration:

def example_function(arg1: int, arg2: str) -> None: ...
asottile commented 5 months ago

please search the issue tracker for duplicates. they are categorized by error code so it should be very easy for you to find the duplicate