google / google/yapf

Function arg indentation changes unpredictably.

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

Description

Hi,

https://github.com/dseomn/pepper-music-player/commit/23b7001d3d054b950d8f42ef48eb828ba82fc9d4 is formatted with yapf 0.28.0, google style, and it looks right to me. The CI ran with yapf 0.29.0 though, and it wanted to change the indent in a way that seems wrong to me: https://github.com/dseomn/pepper-music-player/runs/380708720

I tried coming up with a simpler case to reproduce the issue, and I've got one, but it seems unrelated to the change above, so I don't think I understand what's happening at all. Anyway, this passes 0.28.0 with google style, but fails on 0.29.0:

```python
def f(
a: str,
b: str,
):
pass
```

However, this passes both 0.28.0 and 0.29.0:

```python
def f(
a: str,
b: str,
) -> None:
pass
```

I don't understand what's going on here at all, but it seems like a bug to me.

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.