google / google/yapf

No blank line after if/for/while/def, etc.

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

Description

Currently, yapf formats the following code:

```python
if True:

print(2)
```

like this:
```python
if True:

print(2)
```

However, I don't want to have blank lines right at the beginning of blocks, e.g. I want yapf to do this:

```python
if True:
print(2)
```

I thought that a knob would exist for this for sure, but I wasn't able to find it - could you please point me in the right direction?

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.