google / google/yapf

Can split_before_first_argument only be applied to function calls?

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

Description

I wonder if the following format result can be achieved:
```python
test_values = (
function_call(
'some', 'really', 'long', 'list', 'of', 'values', 'to', 'test', 'with',
'in', 'the', 'config', 'parser'),
('some', 'really', 'long', 'list', 'of', 'values', 'to', 'test', 'with',
'in', 'the', 'config', 'parser'),
)
```

I've played with the `split_before_first_argument` knob, but it either applies to both the function call and the tuple,
```python
test_values = (
function_call(
'some', 'really', 'long', 'list', 'of', 'values', 'to', 'test', 'with',
'in', 'the', 'config', 'parser'),
(
'some', 'really', 'long', 'list', 'of', 'values', 'to', 'test', 'with',
'in', 'the', 'config', 'parser'),
)
```
or neither
```python
test_values = (
function_call('some', 'really', 'long', 'list', 'of', 'values', 'to',
'test', 'with', 'in', 'the', 'config', 'parser'),
('some', 'really', 'long', 'list', 'of', 'values', 'to', 'test', 'with',
'in', 'the', 'config', 'parser'),
)
```

Here is the yapf config file I've used
```
[style]
based_on_style = google
column_limit=80
# split_before_first_argument=True
```

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.