google / google/yapf

split_all_top_level_comma_separated_values makes force_multiline_dict ineffective

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

Description

```console
$ yapf --version
yapf 0.30.0
$ cat .style.yapf
```
```ini
[style]
each_dict_entry_on_separate_line=True
force_multiline_dict=True
split_all_top_level_comma_separated_values=True
```
```console
$ cat test.py
```
```py
COLOR_GROUPS = {
'Meta-switches': magenta,
'Switches': yellow,
'Subcommands': blue
}
```
```console
$ yapf --style .style.yapf -d test.py
```
```diff
--- test.py (original)
+++ test.py (reformatted)
@@ -1,5 +1,3 @@
COLOR_GROUPS = {
- 'Meta-switches': magenta,
- 'Switches': yellow,
- 'Subcommands': blue
+ 'Meta-switches': magenta, 'Switches': yellow, 'Subcommands': blue
}
```

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.