To Reproduce
Unformatted code:
def main():
if a:
# Comment
def b():
pass
if b:
def c():
pass
Running black --preview:
def main():
if a:
# Comment
def b():
pass
if b:
def c():
pass
Expected behavior
Empty line should be consistent added (or removed) between the code block open and inner function:
def main():
if a:
# Comment
def b():
pass
if b:
def c():
pass
Or,
def main():
if a:
# Comment
def b():
pass
if b:
def c():
pass
Additional context
I did a bisect and this was caused by #3035.
Note that if the inner function doesn't have a leading comment, it won't remove the empty line:
def main():
if a:
def b():
pass
def c():
pass
Thus I believe this is an undesired behavior change in #3035?
To Reproduce
Unformatted code:
Running
black --preview:Expected behavior
Empty line should be consistent added (or removed) between the code block open and inner function:
Or,
Additional context
I did a bisect and this was caused by #3035.
Note that if the inner function doesn't have a leading comment, it won't remove the empty line:
Thus I believe this is an undesired behavior change in #3035?