You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azureblade3808
changed the title
Empty line and "unindent does not match any outer indentation level"
Empty line and ... and "unindent does not match any outer indentation level"
Mar 25, 2024
% black -c '''class C:
def f(self):
...
'''
class C:
def f(self):
...
error: cannot format <string>: unindent does not match any outer indentation level (<tokenize>, line 5)
Hi, my friend, @peterkra25 , and I are two students from the University of Michigan enrolled in a software engineering class (EECS 481), and our final project is to contribute to an open-source Github project. We came across Black and saw this issue, and reached out to @JelleZijlstra regarding this. We're looking into this issue and will try to resolve it over the next few weeks.
One more thought: I haven't looked at the code, but I suspect the changes in #3796 are closely related to this bug, so looking at the code affected by that change will be a good way to start finding the location of the bug.
Describe the bug
If the first line inside an indented function is empty and the body is
...
, black fails to format it.To Reproduce
https://black.vercel.app/?version=main&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ACQAFxdAD2IimZxl1N_WlXnON2nzNJyA7rxEz3ITq0Rr8lcyuT-7lJq6-30yBPNldub44lXXOBKYonCShOJuW7cuZ_9TCCgKPjpZqqogwanJNRK0YrZc4gHqvyNL22TtygAACOiGQzKhfHyAAF4kQEAAAC0Mv5wscRn-wIAAAAABFla
Expected behavior
The snippet above can be formatted.
Environment
Additional context
None.
Edit
Function body being
...
is a key condition.The text was updated successfully, but these errors were encountered: