Describe the style change
If a function/class is defined at the start of a non-scoping indent (e.g. if, for) a blank line is inserted before the function.
I would like this removed, since:
- If an indent is scoping (e.g.
def, class) no blank line is inserted and I would prefer if style was consistent.
- I believe this is redundant since the indent already separates the function/class definition well enough.
Examples in the current Black style
# No blank lines
def f():
def g():
pass
class A:
def g():
pass
# Blank lines
for _ in range(10):
def g():
pass
if True:
def g():
pass
Desired style
# No blank lines
def f():
def g():
pass
class A:
def g():
pass
# Also, no blank lines
for _ in range(10):
def g():
pass
if True:
def g():
pass
Additional context
The issue came up when my team was developing a tool to remove blank lines at the start of indents, would be cool if black autocorrected that as well.
Describe the style change
If a function/class is defined at the start of a non-scoping indent (e.g.
if,for) a blank line is inserted before the function.I would like this removed, since:
def,class) no blank line is inserted and I would prefer if style was consistent.Examples in the current Black style
Desired style
Additional context
The issue came up when my team was developing a tool to remove blank lines at the start of indents, would be cool if black autocorrected that as well.