-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
"fmt: on" does not work when crossing block boundaries and decorators #560
Comments
I don't know if this is even fixable in the general case. What I find problematic, though, is that a |
Thanks for your report, we'll tackle this for the next release. |
Got same issue but for a flipped on/off:
Where I only want to reformat some part of the code., and all the end of the file got reformatted. |
PR merged. Thanks! |
The bug causing me to turn off Black formatting for the Click main function (psf/black#560) has been resolved.
The bug causing me to turn off Black formatting for the Click main function (psf/black#560) has been resolved.
The bug causing me to turn off Black formatting for the Click main function (psf/black#560) has been resolved.
Operating system: Linux Mint 19.0
Python version: 3.6.6
Black version: 18.9b0
Does also happen on master: yes
Simplest reproducer: the following is left unchanged. In fact, it behaves as if
# fmt: off
is true until end of file.The soonest
# fmt: on
takes effect is at end of the indentedif
block.Ran into this with a series of decorators:
Simple workaround for me is keep the formatter commands within a "block" - the following works perfectly fine:
The text was updated successfully, but these errors were encountered: