google / google/yapf

Inconsistent line break after dictionary key

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

Description

yapf 0.32.0

```python
# formatted with yapf --no-local-style

def func(x):
return x

matrix = {
'ident': func([
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
]),
'zero': func([
[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
]),
}

matrix_with_half = {
'ident':
func([
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
]),
'zero':
func([
[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
]),
'half':
func([
[1 / 2, 1 / 2, 1 / 2],
[1 / 2, 1 / 2, 1 / 2],
[1 / 2, 1 / 2, 1 / 2],
]),
}

matrix_with_half_and_single_zero = {
'ident':
func([
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
]),
'zero':
func([
[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
]),
'half':
func([
[1 / 2, 1 / 2, 1 / 2],
[1 / 2, 0, 1 / 2],
[1 / 2, 1 / 2, 1 / 2],
]),
}

matrix_with_half_and_single_zero_but_with_short_name = {
'ident': func([
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
]),
'zero': func([
[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
]),
'h': func([
[1 / 2, 1 / 2, 1 / 2],
[1 / 2, 0, 1 / 2],
[1 / 2, 1 / 2, 1 / 2],
]),
}
```

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.