Skip to content

Commit 32fa8b6

Browse files
authored
Skip "magic trailing comma" when formatting with black (#5170)
The "magic trailing comma" is a comma at the end of bracketed list that forces black to format the list entries on separate lines, even if they would fit on one line. For example, if you write: ```python foo(a, b,) ``` black will see that trailing comma and format this as: ```python foo( a, b, ) ``` But with the `skip-magic-trailing-comma` setting enabled this will format on a single line instead ```python foo(a, b) ``` IME the trailing commas are almost always unintentional, e.g. left over from other refactos, and result in wasted vertical space. I suggest we enable this flag.
1 parent dba5f65 commit 32fa8b6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
line-length = 100
33
target_version = ['py36', 'py37', 'py38']
44
skip-string-normalization = true
5+
skip-magic-trailing-comma = true

0 commit comments

Comments
 (0)