Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major indentation failure when # fmt: off falls out of scope #1019

Closed
rwarren opened this issue Sep 13, 2019 · 2 comments
Closed

Major indentation failure when # fmt: off falls out of scope #1019

rwarren opened this issue Sep 13, 2019 · 2 comments
Labels
T: bug Something isn't working

Comments

@rwarren
Copy link

rwarren commented Sep 13, 2019

Black v19.3b0

Playground link

Options

--line-length=89

Input

def bar():
    # fmt: off
    x=1

y=2

Output

def bar():
    # fmt: off
    x=1

    y = 2

Expected

def bar():
    # fmt: off
    x=1

y = 2

This seems somewhat related to #884, but this is a concise case.

This is a major bug since it actually changes the resulting code significantly.

@rwarren
Copy link
Author

rwarren commented Sep 13, 2019

In case it wasn't obvious, the problem is that the y = 2 line got moved into the function (!!).

@zsol zsol added the T: bug Something isn't working label Dec 20, 2019
@zsol
Copy link
Collaborator

zsol commented Dec 20, 2019

This seems like the same case as #569, let's keep the discussion there

@zsol zsol closed this as completed Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants