Skip to content

Black causes W1404 Implicit string concatenation found in assignment (implicit-str-concat) #1837

@vertti

Description

@vertti

Describe the bug

When Black decides a multiline string can be put to single line, it leaves the concatenation in place rather than merging them to a single string. This is considered a bug pattern by Pylint and does seem to be a bug rather than a feature from Black.

To Reproduce Steps to reproduce the behavior:

Having code something like this:

foo = (
  "not really super long line "
  "but enough that I split it"
)

will, when line length allows, be pulled by Black to:

foo = "not really super long line " "but enough that I split it"

rather than a single string.

Expected behavior

In the above situation I would have expected the result to be:

foo = "not really super long line but enough that I split it"

instead of single-line implicit concatenation that is by default flagged by Pylint (W1404)

**Environment **

  • Version: master
  • OS and Python version: Ubuntu 20.10, Python 3.8.5

Does this bug also happen on master?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions