google / google/yapf

Options for preferring hanging indents with one item per line when formating lists

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

Description

I would like to add options/code so that yapf can be configured to prefer outputting something like

```
MyLongNamedTuple = (
something.somethingelse,
something.somethingelse,
foo=(
bar.somethingelse,
something.asdfas,
),
)
```

over

```
MyLongNamedTuple = ( something.somethingelse,
something.somethingelse, foo=( bar.somethingelse,
something.asdfas),)
```

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Reproduce the two formatting examples with YAPF, then trace the formatter's option handling and list-formatting behavior; done means a documented configuration produces the requested one-item-per-line hanging-indent output without breaking the nested example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.