ruff
ruff copied to clipboard
Formatter --preview add trailing comma
I have the following code:
self._edits.append(
{"operation": "update", "id": index, "fields": list(fields), "region_fields": []}
)
Which I run with ruff format --preview
and gets
self._edits.append({
"operation": "update",
"id": index,
"fields": list(fields),
"region_fields": [],
})
I would expect it to behave like this based on the new rule hug_parens_with_braces_and_square_brackets
self._edits.append({
"operation": "update", "id": index, "fields": list(fields), "region_fields": []
})
Playground example: https://play.ruff.rs/6d3bf559-edf0-47f9-b1fd-1fc3418d7a46