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
There has been some back-and-forth regarding empty line after code block open recently. The latest behavior is to keep zero empty line if that is the case in the original input, or one empty line if the original input has more than one empty lines.
The other exception is that it will remove any empty lines immediately following a statement that introduces a new indentation level.
This is no longer true. Consequently, the given example is also incorrect, as all the empty lines after code block open are shown to be deleted after formatting.
Describe the solution you'd like
I would like the documentation to emphasize the current code style of empty line by rewriting the "The other exception is that...new indentation level" sentence. In addition, I would like the example on the empty line code style to be as follows
# indeffoo():
print("One new line above me will be kept!")
defbar():
print("The original input has no new line above me; we will keep it that way.")
ifcondition:
print("One new line above me will be kept!")
print("There is a newline above me, and that's OK!")
classPoint:
x: inty: int# out# outdeffoo():
print("One new line above me will be kept!")
defbar():
print("The original input has no new line above me; we will keep it that way.")
ifcondition:
print("One new line above me will be kept!")
print("There is a newline above me, and that's OK!")
classPoint:
x: inty: int
Describe alternatives you've considered
NA
Additional context
NA
The text was updated successfully, but these errors were encountered:
FanchenBao
changed the title
The current behavior of empty lines is NOT reflected in the current code style documentation
The latest behavior of empty lines is NOT reflected in the current code style documentation
Feb 18, 2024
Is this related to a problem? Please describe.
There has been some back-and-forth regarding empty line after code block open recently. The latest behavior is to keep zero empty line if that is the case in the original input, or one empty line if the original input has more than one empty lines.
However, this behavior is NOT reflected in the documented code style on empty lines. In the documentation, it is stated that
This is no longer true. Consequently, the given example is also incorrect, as all the empty lines after code block open are shown to be deleted after formatting.
Describe the solution you'd like
I would like the documentation to emphasize the current code style of empty line by rewriting the "The other exception is that...new indentation level" sentence. In addition, I would like the example on the empty line code style to be as follows
Describe alternatives you've considered
NA
Additional context
NA
The text was updated successfully, but these errors were encountered: