google / google/yapf

Two unnecessary blank lines added before the comment

Open
#810 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

Hello,
I have checked the following code (which is consistent with PEP8):
```
def foo():
if True:
a = 5
# }
```
and found that it is formatted by yapf as follows:
```
def foo():
if True:
a = 5

# }
```
Seems that this is a bug because there is no other function after the comment. Even if the code of `foo()` continues after the comment, two blank lines are added.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.