A knob to make EACH_DICT_ENTRY_ON_SEPARATE_LINE recursive.
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following:
```
- log({
- "type": "networking.cluster.node_sharing",
- "message": f"Sent our node-list to cluster node {self._nodes_by_fileno[fileno]}",
- "data": {
- "addr": self._sockets[fileno]['addr'][0],
- "port": self._sockets[fileno]['addr'][1],
- "fileno": fileno,
- "payload": data,
- "nodes": self._nodes
- }
- }, level=logging.INFO)
+ log(
+ {
+ "type": "networking.cluster.node_sharing",
+ "message": f"Sent our node-list to cluster node {self._nodes_by_fileno[fileno]}",
+ "data": {
+ "addr": self._sockets[fileno]['addr'][0], "port": self._sockets[fileno]['addr'][1], "fileno": fileno, "payload": data, "nodes": self._nodes
+ }
+ },
+ level=logging.INFO
+ )
```
With the following Yapf configuration:
```toml
[tool.yapf]
BASED_ON_STYLE = "pep8"
COLUMN_LIMIT = 236
USE_TABS = true
CONTINUATION_ALIGN_STYLE = "VALIGN-RIGHT"
SPACES_BEFORE_COMMENT = 1
SPLIT_BEFORE_FIRST_ARGUMENT = true
SPLIT_BEFORE_CLOSING_BRACKET = true
SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES = true
INDENT_DICTIONARY_VALUE = true
SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED = false
DEDENT_CLOSING_BRACKETS = true
SPACE_BETWEEN_ENDING_COMMA_AND_CLOSING_BRACKET = true
SPLIT_BEFORE_DICT_SET_GENERATOR = true
EACH_DICT_ENTRY_ON_SEPARATE_LINE = true
```
I would have assumed (new to Yapf) that setting `EACH_DICT_ENTRY_ON_SEPARATE_LINE` would affect all entries of a dictionary, not just the top level. It can probably be achieved by lowering the column limit (or some other way?) but I'd prefer to be able to tweak the outcome independently of each other.
Contributor guide
Assessment
This issue has not been assessed yet.