Add trailing comma test case for hugging parens (#3991)
This commit is contained in:
parent
caef19689b
commit
c712d57ca9
@ -139,6 +139,19 @@ foo([
|
||||
])
|
||||
```
|
||||
|
||||
You can use a magic trailing comma to avoid this compacting behavior; by default,
|
||||
_Black_ will not reformat the following code:
|
||||
|
||||
```python
|
||||
foo(
|
||||
[
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
],
|
||||
)
|
||||
```
|
||||
|
||||
### Improved multiline string handling
|
||||
|
||||
_Black_ is smarter when formatting multiline strings, especially in function arguments,
|
||||
|
@ -36,6 +36,14 @@ def foo_square_brackets(request):
|
||||
]
|
||||
)
|
||||
|
||||
func(
|
||||
[
|
||||
'a',
|
||||
'b',
|
||||
'c',
|
||||
],
|
||||
)
|
||||
|
||||
func( # a
|
||||
[ # b
|
||||
"c", # c
|
||||
@ -171,6 +179,14 @@ def foo_square_brackets(request):
|
||||
"c",
|
||||
])
|
||||
|
||||
func(
|
||||
[
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
],
|
||||
)
|
||||
|
||||
func([ # a # b
|
||||
"c", # c
|
||||
"d", # d
|
||||
|
Loading…
Reference in New Issue
Block a user