-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
C: preview styleIssues with the preview and unstable style. Add the name of the responsible feature in the title.Issues with the preview and unstable style. Add the name of the responsible feature in the title.T: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?
Description
Describe the style change
This issue is specific to the new hug_parens_with_braces_and_square_brackets
preview style.
Examples in the current Black style
self._edits.append(
{"operation": "update", "id": index, "fields": list(fields), "region_fields": []}
)
Desired style
self._edits.append({
"operation": "update", "id": index, "fields": list(fields), "region_fields": []
})
The benefit of the desired style in my view are:
-
It minifies the diff when the length of the entires change because the formatting of the
{
remain unchanged:self._edits.append({ "operation": "update", "id": index, "fields": list(fields), "region_fields": [], "loooger": "more", })
or
self._edits.append({ "operation": "update", "id": index, "fields": list(fields)})
-
It feels more consistent with the call expression formatting where the opening are formatted on separated lines (which is necessary to avoid invalid syntax):
self._edits.append( "operation", "update", "id", index, "fields", list(fields), "region_fields", [] )
Additional context
Originally posted in the stable 2024 style issue.
kaste
Metadata
Metadata
Assignees
Labels
C: preview styleIssues with the preview and unstable style. Add the name of the responsible feature in the title.Issues with the preview and unstable style. Add the name of the responsible feature in the title.T: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?