google / google/yapf

Is there a knob for preventing right-hanging line breaks?

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

Description

This is the output from yapf, which breaks up a list of tuples at a strange spot. I would like it to either put the list on a new line or make the break more "balanced", but I couldn't see a knob for doing this.

```
def test_plain_old_data(self):
self.assertEqual(a_node._asdict(),
collections.OrderedDict([('a', 1), ('b', 2), ('c',
3)]))
```

I'd prefer one of these for the assertEqual:

```
self.assertEqual(a_node._asdict(),
collections.OrderedDict([
('a', 1), ('b', 2), ('c', 3)]))
```

or

```
self.assertEqual(a_node._asdict(),
collections.OrderedDict([('a', 1), ('b', 2),
('c', 3)]))
```

or

```
self.assertEqual(
a_node._asdict(),
collections.OrderedDict([('a', 1), ('b', 2), ('c', 3)]))
```

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.