Do not wrap implicitly concatenated strings used as func args in parens. · psf/black@968bb6c (original) (raw)

`@@ -323,10 +323,8 @@ def foo():

`

323

323

`y = "Short string"

`

324

324

``

325

325

`print(

`

326

``

`-

(

`

327

``

`-

"This is a really long string inside of a print statement with extra arguments"

`

328

``

`-

" attached at the end of it."

`

329

``

`-

),

`

``

326

`+

"This is a really long string inside of a print statement with extra arguments"

`

``

327

`+

" attached at the end of it.",

`

330

328

`x,

`

331

329

`y,

`

332

330

`z,

`

`@@ -501,15 +499,13 @@ def foo():

`

501

499

`)

`

502

500

``

503

501

`bad_split_func1(

`

504

``

`-

(

`

505

``

`-

"But what should happen when code has already "

`

506

``

`-

"been formatted but in the wrong way? Like "

`

507

``

`-

"with a space at the end instead of the "

`

508

``

`-

"beginning. Or what about when it is split too "

`

509

``

`-

"soon? In the case of a split that is too "

`

510

``

`-

"short, black will try to honer the custom "

`

511

``

`-

"split."

`

512

``

`-

),

`

``

502

`+

"But what should happen when code has already "

`

``

503

`+

"been formatted but in the wrong way? Like "

`

``

504

`+

"with a space at the end instead of the "

`

``

505

`+

"beginning. Or what about when it is split too "

`

``

506

`+

"soon? In the case of a split that is too "

`

``

507

`+

"short, black will try to honer the custom "

`

``

508

`+

"split.",

`

513

509

`xxx,

`

514

510

`yyy,

`

515

511

`zzz,

`

`@@ -612,11 +608,9 @@ def foo():

`

612

608

`)

`

613

609

``

614

610

`arg_comment_string = print(

`

615

``

`-

( # This comment gets thrown to the top.

`

616

``

`-

"Long lines with inline comments which are apart of (and not the only member"

`

617

``

`-

" of) an argument list should have their comments appended to the reformatted"

`

618

``

`-

" string's enclosing left parentheses."

`

619

``

`-

),

`

``

611

`+

"Long lines with inline comments which are apart of (and not the only member of) an"

`

``

612

`+

" argument list should have their comments appended to the reformatted string's"

`

``

613

`+

" enclosing left parentheses.", # This comment gets thrown to the top.

`

620

614

`"Arg #2",

`

621

615

`"Arg #3",

`

622

616

`"Arg #4",

`

`@@ -676,31 +670,23 @@ def foo():

`

676

670

`)

`

677

671

``

678

672

`func_with_bad_comma(

`

679

``

`-

(

`

680

``

`-

"This is a really long string argument to a function that has a trailing comma"

`

681

``

`-

" which should NOT be there."

`

682

``

`-

),

`

``

673

`+

"This is a really long string argument to a function that has a trailing comma"

`

``

674

`+

" which should NOT be there.",

`

683

675

`)

`

684

676

``

685

677

`func_with_bad_comma(

`

686

``

`-

( # comment after comma

`

687

``

`-

"This is a really long string argument to a function that has a trailing comma"

`

688

``

`-

" which should NOT be there."

`

689

``

`-

),

`

``

678

`+

"This is a really long string argument to a function that has a trailing comma"

`

``

679

`+

" which should NOT be there.", # comment after comma

`

690

680

`)

`

691

681

``

692

682

`func_with_bad_comma(

`

693

``

`-

(

`

694

``

`-

"This is a really long string argument to a function that has a trailing comma"

`

695

``

`-

" which should NOT be there."

`

696

``

`-

),

`

``

683

`+

"This is a really long string argument to a function that has a trailing comma"

`

``

684

`+

" which should NOT be there.",

`

697

685

`)

`

698

686

``

699

687

`func_with_bad_comma(

`

700

``

`-

( # comment after comma

`

701

``

`-

"This is a really long string argument to a function that has a trailing comma"

`

702

``

`-

" which should NOT be there."

`

703

``

`-

),

`

``

688

`+

"This is a really long string argument to a function that has a trailing comma"

`

``

689

`+

" which should NOT be there.", # comment after comma

`

704

690

`)

`

705

691

``

706

692

`func_with_bad_parens_that_wont_fit_in_one_line(

`