Commit 32fa8b6
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
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
0 commit comments