google / google/yapf

Dict formatting with 0.16.1

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

Description

Dict formatting seems weird under 0.16.1. The value is added to a new line under the key, this seems somewhat silly, especially when the line length doesn't exceed `column_limit`. I don't see a tunable to disable this.

```
[style]
based_on_style = pep8
column_limit = 79
```

```
x = {
- 'ansible_host': '127.0.0.1',
- 'ansible_port': 2222,
- 'ansible_user': 'vagrant',
- 'ansible_private_key_file': '"/foo/bar"',
- 'connection': 'ssh',
+ 'ansible_host':
+ '127.0.0.1',
+ 'ansible_port':
+ 2222,
+ 'ansible_user':
+ 'vagrant',
+ 'ansible_private_key_file':
+ '"/foo/bar"',
+ 'connection':
+ 'ssh',
'ansible_ssh_extra_args': ('-o UserKnownHostsFile=/dev/null '
'-o ControlMaster=auto '
'-o ControlPersist=60s '
```

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.